Christmas Tree Star
The ModMy Pi Christmas Tree Star is an LED add-on board for the Raspberry Pi designed to go on top of your Christmas tree. There are 30 white LEDs controllable through a Python library which extends GPIO Zero and is available on GitHub.
Features
- 30 white LEDs
- GPIO Zero compatible library.
- Mounting points for Raspberry Pi Zero.
- Christmas Tree build guide
Sample Code
from star import Star
from time import sleep
# Initialise the star
star = Star()
# Turn the star on and off.
star.on()
sleep(1)
star.off()
# Turn the inner and outer LEDs off.
star.outer.on()
sleep(1)
star.off()
star.inner.on()
sleep(1)
star.off()
# Turn on individual LEDs on the outer rim.
star.outer.A.on()
star.outer.F.on()
star.outer.P.on()
star.outer.X.on()
sleep(1)
star.off()
详情 |