A program that lights up arcade buttons according to the buttons used in the game currently being played. This pairs up nicely with the custom Arduino arcade controller I made.
Before Retropie boots a game, it first runs a runcommand file. This script can be appended to that file.
./rpi_button_lights.py is the main file, ./test_lights.py can be used to make sure your wiring is correct.
rpi-arcade-lights.demo.mp4
Alternatively, see on Youtube.
Adafruit PCA9685 | Raspberry Pi | |
---|---|---|
GND | --> | GND |
OE | --> | |
SCL | --> | 5 |
SDA | --> | 3 |
VCC | --> | 3V3 |
- Enable I2C:
You will probably get this error ValueError: No Hardware I2C on (scl,sda)=(3, 2)
. So we need to enable I2C via sudo raspi-config
> Interface Options > I2C.
-
Reboot the Pi
-
Run the following commands:
pip3 install -r requirements.txt cp rpi_button_lights.py /usr/local/bin/ cd /usr/local/bin/ chmod a+x rpi_button_lights.py cd -
cp rpi_button_lights_database.csv /usr/local/etc/
cp event_hook_scripts/runcommand-onstart.sh /opt/retropie/configs/all cd /opt/retropie/configs/all chmod a+x runcommand-onstart.sh cd -
cp event_hook_scripts/runcommand-onend.sh /opt/retropie/configs/all cd /opt/retropie/configs/all chmod a+x runcommand-onend.sh cd -
sudo cp event_hook_scripts/arcade-button-lights.service /etc/systemd/system sudo chmod a+x arcade-button-lights.service sudo systemctl enable arcade-button-lights
Find button configurations by Google Image searching: controls site:gamesdatabase.org.
Add games as a new row in the rpi_button_lights_database.csv file.