Traffic Lights - the logic behind it
How do traffic lights work? I mean logically how do they work? Well I had to figure it out with several of my friends as a part of a workshop. Let's start with asking what's the point of a traffic light? So the point of a traffic light is the guide cars and other traffic and to prevent complete chaos on the streets. A traffic light has three states which mean different things; red, yellow and green. Red to stop, yellow to prepare to stop and green to go. Take a regular crossing where two perpendicular roads cross, and name them North/South and East/West. Start with N/S at red. E/W is at green and going. Wait 30 seconds. Switch E/W to yellow. Wait 3 seconds. Switch it to red. Wait 3 seconds again. Switch N/S to green. Wait 30 seconds. Switch it to yellow. Wait 3 seconds. Switch to red. Wait 3 seconds. Switch E/W to green. Repeat. It sounds unnecessarily long and complicated but computers need exact instructions to do their tasks. A robot arm at a factory wo...