diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-07 18:55:31 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-07 18:55:31 +0100 |
commit | 9102af6afbc65bb7c4597e3f8371f6e72a6aebd9 (patch) | |
tree | d056d9064584524f28bd66f33d2c6ae89003b358 /tests/pybnative/while.py | |
parent | c4ccb078a52276fc95e407602676f14d34a3f3c1 (diff) |
tests: Add a test for native code on pyboard.
Diffstat (limited to 'tests/pybnative/while.py')
-rw-r--r-- | tests/pybnative/while.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pybnative/while.py b/tests/pybnative/while.py new file mode 100644 index 000000000..a3f64a800 --- /dev/null +++ b/tests/pybnative/while.py @@ -0,0 +1,14 @@ +@micropython.native +def f(led, n): + led.off() + i = 0 + while i < n: + led.toggle() + d = pyb.delay + d(50) # pyb.delay(50) doesn't work! + i += 1 + print(i) + led.off() + +f(pyb.LED(1), 2) +f(pyb.LED(2), 4) |