2021-08-31 15:43:41 +01:00
|
|
|
import time, pyb
|
2014-05-07 23:27:45 +01:00
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
|
2014-05-07 18:55:31 +01:00
|
|
|
@micropython.native
|
2014-05-07 23:27:45 +01:00
|
|
|
def f(led, n, d):
|
2014-05-07 18:55:31 +01:00
|
|
|
led.off()
|
|
|
|
i = 0
|
|
|
|
while i < n:
|
2014-05-07 23:27:45 +01:00
|
|
|
print(i)
|
2014-05-07 18:55:31 +01:00
|
|
|
led.toggle()
|
2021-08-31 15:43:41 +01:00
|
|
|
time.sleep_ms(d)
|
2014-05-07 18:55:31 +01:00
|
|
|
i += 1
|
|
|
|
led.off()
|
|
|
|
|
2020-03-23 02:26:08 +00:00
|
|
|
|
2014-05-07 23:27:45 +01:00
|
|
|
f(pyb.LED(1), 2, 150)
|
|
|
|
f(pyb.LED(2), 4, 50)
|