def initialize_gpio():
GPIO.setmode(GPIO.BOARD)
GPIO.setup([11, 32, 36], GPIO.OUT) # LEDs: Blue (metronome), Green (ok), Red (error)
GPIO.setup(31, GPIO.IN)
GPIO.output([32, 36], GPIO.LOW)
GPIO.add_event_detect(31, GPIO.BOTH, callback=intercept_morse_code)
# Blink a blue LED on/off (one full cycle per BASE_TIME_SECONDS)
评论列表
文章目录