2014-05-07 18:27:45 -04:00
|
|
|
import pyb
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-05-07 13:55:31 -04:00
|
|
|
@micropython.native
|
2014-05-07 18:27:45 -04:00
|
|
|
def f(led, n, d):
|
2014-05-07 13:55:31 -04:00
|
|
|
led.off()
|
|
|
|
i = 0
|
|
|
|
while i < n:
|
2014-05-07 18:27:45 -04:00
|
|
|
print(i)
|
2014-05-07 13:55:31 -04:00
|
|
|
led.toggle()
|
2014-05-07 18:27:45 -04:00
|
|
|
pyb.delay(d)
|
2014-05-07 13:55:31 -04:00
|
|
|
i += 1
|
|
|
|
led.off()
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-05-07 18:27:45 -04:00
|
|
|
f(pyb.LED(1), 2, 150)
|
|
|
|
f(pyb.LED(2), 4, 50)
|