micropython/examples/hwapi/button_led.py
Paul Sokolovsky 3c0da6a359 examples/hwapi: button_led: Add GPIO pin read example.
Requires BUTTON defined in hwconfig, so far tested on DragonBoard 410c.
2016-11-12 00:09:43 +03:00

10 lines
180 B
Python

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)