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:
committed by
Damien George
parent
44dc6eb30d
commit
4601dcb8a1
@@ -69,7 +69,6 @@ from machine import Pin, Timer
|
|||||||
led = Pin(25, Pin.OUT)
|
led = Pin(25, Pin.OUT)
|
||||||
tim = Timer()
|
tim = Timer()
|
||||||
def tick(timer):
|
def tick(timer):
|
||||||
global led
|
|
||||||
led.toggle()
|
led.toggle()
|
||||||
|
|
||||||
tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)
|
tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)
|
||||||
|
|||||||
Reference in New Issue
Block a user