rp2/README: Remove redundant global statement from example code.

Since `led` is not being rebound inside the `tick` function the standard
Python name resolution method will find it.

Signed-off-by: Steve Holden <steve@holdenweb.com>
This commit is contained in:
Steve Holden
2024-10-24 01:35:02 +01:00
committed by Damien George
parent 44dc6eb30d
commit 4601dcb8a1

View File

@@ -69,7 +69,6 @@ from machine import Pin, Timer
led = Pin(25, Pin.OUT)
tim = Timer()
def tick(timer):
global led
led.toggle()
tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)