-
Notifications
You must be signed in to change notification settings - Fork 10
GPIO LED
HerbFargus edited this page Dec 4, 2017
·
3 revisions
There are endless projects that can utilise the GPIO pins on a Raspberry Pi, this has a few simple examples on how to work with LED's on the GPIO pins.
The main package we'll be using is GPIO Zero
sudo apt-get install python-gpiozero python3-gpiozero
Creating python scripts:
nano yourpythonscript.py
from gpiozero import LED
from signal import pause
red = LED(17)
red.blink()
pause()
from gpiozero import PWMLED
from signal import pause
led = PWMLED(17)
led.pulse()
pause()
Creating a dialog gui to run python scripts:
https://unix.stackexchange.com/questions/155636/dialog-menu-to-display-files-and-select-one-of-them
and
https://github.com/folkien/scripts/blob/493bff8f2ff8abc2344d6a99d75d8e21505fdf89/filelist.sh