Please always shutdown the Pi gracefully to prevent the SD card from getting corrupted.
sudo shutdown -h now
Sounds are currently missing in this repository, I will add them later.
- Power on Pi (plug in extension cord)
- Open the terminal with
ctrl
+alt
+t
or connect via ssh. For example:ssh voetbaltafel@192.168.1.103
. Password isvoetbaltafel
. - Setup display port
export DISPLAY=:0
- Navigate to project
cd ~/Documents/voetbaltafel/
- Start script
python main.py
The game will be reset once one of the teams reaches a score of 10.
Make sure sound is set to headphone jack output (not auto or HDMI)
sudo raspi-config
Navigate to System Options
> Audio
> select headphone output (probably 0).
export DISPLAY=:0
- Football table
- Raspberry Pi 3B+
- Micro USB adapter
- 2x Beam break sensors
- 2x breadboard
- 2x female female 3 pin cable (70cm)
- a few jumper wires (male male)
- PC speakers (3,5mm jack)
- Monitor (HDMI)
- HDMI cable
- Extension cord (power)
Install Raspberry Pi OS on a micro SD card, https://www.raspberrypi.com/software/
Place micro SD card in Pi and complete setup wizard
- Recommended: set language to
English
and keyboard toUS
- Set both username and password as
voetbaltafel
- Recommended: Connect to a Wi-Fi network for SSH connection later
3a. Recommended: Enable SSH
3b. Reboot
sudo reboot
3c. Change startup sequence
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add the following:
@xset s noblank
@xset s off
@xset -dpms
3d.Recommended: Install additional fonts
sudo apt-get install ttf-mscorefonts-installer
3e. Reboot
sudo reboot
Deploy files to Pi with scp. For example:
scp -r ./voetbaltafel voetbaltafel@192.168.1.103:~/Documents
Currently aimed at development on macOS.
Problems using Python on macOS? See https://opensource.com/article/19/5/python-3-default-mac I used Python 3.9.10
pip install git+https://github.com/nosix/raspberry-gpio-emulator
or
pyenv exec pip install git+https://github.com/nosix/raspberry-gpio-emulator
pip install pygame
or
pyenv exec pip install pygame
Sound effects from Pixabay