From 3c0da6a3592c715fa901e100a6d5ad256f19f67f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 12 Nov 2016 00:09:20 +0300 Subject: examples/hwapi: button_led: Add GPIO pin read example. Requires BUTTON defined in hwconfig, so far tested on DragonBoard 410c. --- examples/hwapi/button_led.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/hwapi/button_led.py (limited to 'examples/hwapi/button_led.py') diff --git a/examples/hwapi/button_led.py b/examples/hwapi/button_led.py new file mode 100644 index 0000000000..bd6fe01729 --- /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) -- cgit v1.2.3