diff options
| author | Damien George | 2014-05-07 18:55:31 +0100 |
|---|---|---|
| committer | Damien George | 2014-05-07 18:55:31 +0100 |
| commit | 9102af6afbc65bb7c4597e3f8371f6e72a6aebd9 (patch) | |
| tree | d056d9064584524f28bd66f33d2c6ae89003b358 /tests/pybnative | |
| parent | c4ccb078a52276fc95e407602676f14d34a3f3c1 (diff) | |
tests: Add a test for native code on pyboard.
Diffstat (limited to 'tests/pybnative')
| -rw-r--r-- | tests/pybnative/while.py | 14 | ||||
| -rw-r--r-- | tests/pybnative/while.py.exp | 6 |
2 files changed, 20 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) diff --git a/tests/pybnative/while.py.exp b/tests/pybnative/while.py.exp new file mode 100644 index 000000000..5cd83db0f --- /dev/null +++ b/tests/pybnative/while.py.exp @@ -0,0 +1,6 @@ +1 +2 +1 +2 +3 +4 |
