diff options
Diffstat (limited to 'tests/pybnative/while.py')
-rw-r--r-- | tests/pybnative/while.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/pybnative/while.py b/tests/pybnative/while.py index a3f64a800c..3ea7221ea7 100644 --- a/tests/pybnative/while.py +++ b/tests/pybnative/while.py @@ -1,14 +1,15 @@ +import pyb + @micropython.native -def f(led, n): +def f(led, n, d): led.off() i = 0 while i < n: + print(i) led.toggle() - d = pyb.delay - d(50) # pyb.delay(50) doesn't work! + pyb.delay(d) i += 1 - print(i) led.off() -f(pyb.LED(1), 2) -f(pyb.LED(2), 4) +f(pyb.LED(1), 2, 150) +f(pyb.LED(2), 4, 50) |