2014-05-07 23:27:45 +01:00
|
|
|
import pyb
|
|
|
|
|
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()
|
2014-05-07 23:27:45 +01:00
|
|
|
pyb.delay(d)
|
2014-05-07 18:55:31 +01:00
|
|
|
i += 1
|
|
|
|
led.off()
|
|
|
|
|
2014-05-07 23:27:45 +01:00
|
|
|
f(pyb.LED(1), 2, 150)
|
|
|
|
f(pyb.LED(2), 4, 50)
|