This project is a private project and the first non-guided, self-imagined of mine.
It has 3 LEDs (Red, Yellow, Green) on a breadboard connected to 3 different pins on a Raspberry Pi 2B. Furthermore the LEDs will be controllable with a button, running the standard traffic light sequence: R, RY, G, Y, R
Details
Programming Language(s):
Python 3
Files
trfc_light.py
Python 3 code to control the traffic light with a button.
I had to move the buttons control pin from Pin 2 to Pin 8 because the pins 2 & 3 have a built-in pull resistance which I didn't know by the time I was making the projects layout.
The Python code as it is in its current state, checks the status of the button every 0.5s.
This is just an emergency solution because in the initial state of the code, the button was checked several hundred times a second (no sleep-function) which led to an issue where you press the button and the status variable changes its state to fast and therefore you ended up with weird signals.