circuitpython/tests/pybnative/while.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
235 B
Python
Raw Normal View History

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)