Skip to content
Snippets Groups Projects
Commit d9f4deef authored by Damien George's avatar Damien George
Browse files

Merge pull request #547 from cjbarnes18/pyboard_module_fixes

Fix pyboard.py tests.
parents b37c0a11 71a1e352
Branches
Tags
No related merge requests found
...@@ -110,16 +110,17 @@ def run_test(): ...@@ -110,16 +110,17 @@ def run_test():
pyb.exec('def apply(l, f):\r\n for item in l:\r\n f(item)\r\n') 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())') pyb.exec('apply(leds, lambda l:l.off())')
## USR switch test ## USR switch test
if True: pyb.exec('switch = pyb.Switch()')
for i in range(2): for i in range(2):
print("press USR button") print("press USR button")
pyb.exec('while pyb.switch(): pyb.delay(10)') pyb.exec('while switch(): pyb.delay(10)')
pyb.exec('while not pyb.switch(): pyb.delay(10)') pyb.exec('while not switch(): pyb.delay(10)')
print('USR switch passed') print('USR switch passed')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment