PiGRRL Zero Plus with Backlight Control

PiGRRL Zero Plus with Backlight Control

thingiverse

This is a PiGRRL Zero with brightness control. This is a purely software remix of the PiGRRL Zero Plus. Please ignore any model files attached to this project. The PiGRRL Zero has NO SOUND. Here's a demo of how it looks: The four brightness settings I chose were Full at 1023/1023, Half at 500/1023, 20 percent at 200/1023, and 5 percent at 50/1023. They closely resemble DS Lite brightness settings, which I was generally happy with. I wrote a gist for the python script that controls brightness: https://gist.github.com/lindsaylandry/f30cc0740bc20461edf79f7c452dcc39. Place this file in /usr/local/bin/backlight.py. Next, I created a systemd service that will call this script upon system startup. Write the following code to /etc/systemd/system/backlight.service: https://gist.github.com/lindsaylandry/b975615a43f82f80e433a400808d2daa. Finally, enable this service with sudo systemctl enable backlight.service. This service doesn't properly start unless the GPIO pins have been properly reassigned. The GPIO responsible for backlight control on a PiTFT is #18, which is by default mapped to the left key. I had to reassign the left key to GPIO 4 both by soldering and adjusting some software. To reassign pins, rewrite the following line of /home/pi/Adafruit-Retrogame/retrogame.c: { 18, KEY_LEFT }, becomes { 4, KEY_LEFT }. Also comment out any reference to GPIO 27 if it exists. //{ 27, KEY_4 }, becomes //key not used anymore. Recompile with the following command: make retrogame. Replace the current retrogame executable (stop retrogame process before doing this) with sudo cp /usr/local/bin/retrogame /usr/local/bin/retrogame-bak and then sudo cp /home/pi/Adafruit-Retrogame/retrogame /usr/local/bin/retrogame. Finally, restart the pigrrl. Backlight service should be up and running! IMPORTANT NOTE: The original build has GPIO 18 used as a sound amplifier because it is a PWM. I couldn't figure out how to have both sound and backlight control, so this build functions with no sound. Sorry folks! If someone could figure out how to have sound work too that would be awesome. Hit me back if you have any questions about this, and happy hacking!

Download Model from thingiverse

With this file you will be able to print PiGRRL Zero Plus with Backlight Control with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on PiGRRL Zero Plus with Backlight Control.