Bits of Discovery

Stuff I Like to Learn About

My First Raspberry Pi Project

So last week I got my Raspberry Pi in the mail, and since the World Cup has rolled around again I decided to create a World Cup scoreboard as my first project. Since I’ve had no previous experience with circuitry and GPIOs beforehand it was quite a gratifying learning experience for me. I was disproportionately happy when I first completed a circuit and lit up a little red LED. I ordered a starter kit so I had a breadboard, LEDs and jumper wires right off the bat. The basic concept is pretty simple. I poll an API every minute (originally I was just scraping ESPN) and light up the scoreboard according to how many goals had been scored on either side. I also programmed a special lighting sequence everytime a goal was scored as a sort of visual cue/celebration. The lights I used are pretty standard single color LEDs and the resistors were 330 ohms. I wired each light with a resistor so the lights wouldn’t burn out and used all of the 8 general purpose pins on the pi, one for each light. Unfortunately that doesn’t allow for all possible game scores but I could have done it in binary if I felt like it (which would defeat the convenience of the whole thing). In any case, here is a picture and the source code! I made it to be callable from the command line:

1
$ python scoreboard.py Germany Argentina