extint_wakeup.py

# Dieses Werk ist unter der MIT-Lizenz lizenziert.
# Copyright (c) 2013-2023 OpenMV LLC. Alle Rechte vorbehalten.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# ExtInt-Beispiel: Aufwachen aus dem Stop-Modus
# Dieses Beispiel zeigt, wie externe Interrupts verwendet werden, um aus dem Energiesparmodus aufzuwachen.

import time
import pyb
import machine
from pyb import Pin, ExtInt


def callback(line):
    pass


led = pyb.LED(3)
pin = Pin("P5", Pin.IN, Pin.PULL_UP)
ext = ExtInt(pin, ExtInt.IRQ_FALLING, Pin.PULL_UP, callback)

# In den Stop-Modus wechseln. Hinweis: Die IDE wird die Verbindung trennen.
machine.sleep()

while True:
    led.on()
    time.sleep_ms(100)
    led.off()
    time.sleep_ms(100)

results matching ""

    No results matching ""