diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-03 00:11:43 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-03 00:11:43 +0100 |
commit | d9f4deef8cbcbeeeaeefebfc53072d83e5bfddc3 (patch) | |
tree | c2aa65da2d59f7993222b71a07374ed25ed8afcc | |
parent | b37c0a116ec723c0628a058130c26239c9ec7724 (diff) | |
parent | 71a1e3520667e19f355c5e761465796a2721bc5a (diff) | |
download | micropython-d9f4deef8cbcbeeeaeefebfc53072d83e5bfddc3.tar.gz micropython-d9f4deef8cbcbeeeaeefebfc53072d83e5bfddc3.zip |
Merge pull request #547 from cjbarnes18/pyboard_module_fixes
Fix pyboard.py tests.
-rw-r--r-- | tools/pyboard.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/pyboard.py b/tools/pyboard.py index a44710914e..2f77ba37ca 100644 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -110,18 +110,19 @@ def run_test(): pyb.exec('def apply(l, f):\r\n for item in l:\r\n f(item)\r\n') - pyb.exec('leds=[pyb.Led(l) for l in range(1, 5)]') + pyb.exec('leds=[pyb.LED(l) for l in range(1, 5)]') pyb.exec('apply(leds, lambda l:l.off())') ## USR switch test - if True: - for i in range(2): - print("press USR button") - pyb.exec('while pyb.switch(): pyb.delay(10)') - pyb.exec('while not pyb.switch(): pyb.delay(10)') + pyb.exec('switch = pyb.Switch()') + + for i in range(2): + print("press USR button") + pyb.exec('while switch(): pyb.delay(10)') + pyb.exec('while not switch(): pyb.delay(10)') - print('USR switch passed') + print('USR switch passed') ## accel test |