Phyduino Pico
MicroPython v0.1.0-rc.1
Physics
›
Electronic Support Services
›
Introduction to Electronics
›
Phyduino Pico MicroPython
›
API reference
Toggle main menu visibility
Loading...
Searching...
No Matches
phyduino/01_basics/blink/main.py
Blink example script (phyduino.py)
Blinks the on-board green LED once a second.
Uses
On-board LED
: Led.toggle()
# Blinks the on-board green LED once a second.
import
time
# sleep() for pauses
import
phyduino
as
mcu
# the Phyduino Pico library, used as mcu.<name>
mcu.led.off()
# start with the LED off
while
True
:
# repeats until stopped: Interrupt in PyCharm, or mpremote soft-reset
mcu.led.toggle()
# on if it was off, off if it was on
time.sleep(0.5)
# wait half a second, so one on-off cycle takes a second
Generated by
1.17.0