Install PIL library:
python3 -m pip install PillowAlso, you need to enable SPI in your raspi-config:
sudo raspi-configGo to "Interface Options" and enable SPI.
Thats it! Now you can run the program:
python3 main.pyThis Program was designed for the Waveshare 2.13 Inch E-Paper Display (Red/Black/White)! You can buy it here.
You can find a tutorial here
This code uses the Pillow library to create the image which will be shown on the display.
The Display show all important informations about the next launch like these:
- Name of the next rocket (and the rocket after that)
- If it lands
- If it was reused
- how often it was reused
- when the rocket will launch
- The time the display refreshed itself
- The SpaceX logo works as a "Progress Bar" (Left side of X=Last launch, Right side= next launch, edge between red/black = current time)
I am still learning, if you see any errors or have a way to code it better, please contact me! :)
Run the commands:
touch spacex.serviceThis creates the file.
sudo nano spacex.servicepaste the following:
[Unit]
Description=SpaceX Tracker
After=network.target
[Service]
ExecStart=/usr/bin/python3 /home/pi/spacex/main.py & #MAKE SURE TO UPDATE PATH!
Restart=always
[Install]
WantedBy=multi-user.target
Now that we have the service, let's copy it to systemd
sudo cp spacex.service /etc/systemd/system/reload systemctl
sudo systemctl daemon-reloadsudo systemctl enable spacex.servicesudo systemctl start spacex.servicesudo cp spacex.service /etc/systemd/system/