Skip to content

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

@GmanBB

Description

@GmanBB

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions