Leider gibt es ein Syntaxproblem in Zeile 11 der Subroutine. Diverse Syntax-Checker zeigen aber kein Problem.
Code: Alles auswählen
import machine
import time
# Define the GPIO pins for the LED and push button
LED_PIN = 0 # GP0
# Initialize the LED pin as an output and the button pin as an input with a pull-up resistor
led = machine.Pin(LED_PIN, machine.Pin.OUT)
# Blinken
blink(anz)
for x in range(anz):
led.on() # Turn on the LED
time.sleep(1)
led.off() # Turn off the LED
time.sleep(1)
#Start
blink (3)