kopia lustrzana https://github.com/micropython/micropython-lib
machine: Add example for Timer class.
rodzic
7fdacc3925
commit
ad00b479eb
|
@ -0,0 +1,11 @@
|
|||
import utime
|
||||
from machine import Timer
|
||||
|
||||
|
||||
t1 = Timer(0, 10)
|
||||
t2 = Timer(1, 3)
|
||||
t1.callback(lambda t: print(t, "tick1"))
|
||||
t2.callback(lambda t: print(t, "tick2"))
|
||||
|
||||
utime.sleep(3)
|
||||
print("done")
|
Ładowanie…
Reference in New Issue