diff options
Diffstat (limited to 'examples/hwapi/button_led.py')
-rw-r--r-- | examples/hwapi/button_led.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/hwapi/button_led.py b/examples/hwapi/button_led.py new file mode 100644 index 000000000..bd6fe0172 --- /dev/null +++ b/examples/hwapi/button_led.py @@ -0,0 +1,9 @@ +import utime +from hwconfig import LED, BUTTON + +# Light LED when (and while) a BUTTON is pressed + +while 1: + LED.value(BUTTON.value()) + # Don't burn CPU + utime.sleep_ms(10) |