piframe/docs/lcd_control.md

1,006 B

LCD Control

The below will setup an Adafruit mini LCD with 2 buttons as a controller for selecting which photo albums are displayed on a PiFrame. This setup also includes the Adafruit stemma/qwiic LUX sensor setup which will be integrated further in the future.


apt install -y python3-pip ttf-dejavu python3-pil python3-numpy

pip3 install adafruit-circuitpython-rgb-display adafruit-circuitpython-bh1750 RPI.GPIO
pip3 install --upgrade --force-reinstall spidev

git clone https://git.kemonine.info/kemonine/piframe.git /opt/piframe
cp /opt/piframe/lcd_control.py /usr/local/bin/
chmod a+x /usr/local/bin/lcd_control.py
cat > /etc/systemd/system/lcd_control.service <<EOF
[Unit]
Description=Control which album is shown as a slideshow
After=fim.service

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/lcd_control.py
TimeoutSec=15
Restart=always

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now lcd_control