Button example script (phyduino.py) Lights the on-board LED while a pushbutton on D2 is pressed.
- Wiring
- A pushbutton between D2 and 3.3 V. The pin's pull-down resistor holds D2 at 0 while the button is open.
import phyduino as mcu
button = mcu.pin("D2", "in", pull="down")
while True:
mcu.led.value(button.value())