circuitpython/tests/pybnative/while.py
Damien George 08ff71dfcd tests/pybnative: Make while.py test run on boards without pyb.delay.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-01 00:43:41 +10:00

18 lines
235 B
Python

import time, pyb
@micropython.native
def f(led, n, d):
led.off()
i = 0
while i < n:
print(i)
led.toggle()
time.sleep_ms(d)
i += 1
led.off()
f(pyb.LED(1), 2, 150)
f(pyb.LED(2), 4, 50)