Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Learn MicroPython #4 - Interrupts (event-driven code) #1

Open
GmanBB opened this issue Aug 4, 2020 · 0 comments
Open

Learn MicroPython #4 - Interrupts (event-driven code) #1

GmanBB opened this issue Aug 4, 2020 · 0 comments

Comments

@GmanBB
Copy link

GmanBB commented Aug 4, 2020

Traceback (most recent call last):
File "", line 13, in
AttributeError: 'Pin' object has no attribute 'irq'
�>
MicroPython ESP32_LoBo_v3.2.24 - 2018-09-06 on ESP32 board with ESP32
Type "help()" for more information.

Video: Learn MicroPython #4 - Interrupts

from machine import Pin

led = Pin(33, Pin.OUT)
btn = Pin(37, Pin.IN)

def my_func(pin):
print("rising!")

Interrupt Request

btn.irq(my_func, Pin.IRQ_RISING)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant