circuitpython/tests/pybnative/while.py

18 lines
225 B
Python
Raw Normal View History

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