I have been making a miniature city, and now i want to add traffic lights on 4 intersections.
These traffic lights need to work all independent from each other (so every intersection has its own light control so not every intersection shows red at the same moment for example)
is there a way to do this? like creating 4 loops maybe ?
I'm pretty new so i ask first before i buy the components.
The basic principle is to have one big loop and to execute the functions in a sequential way
by using a technique that is called state-machine. Traffic-lights are a very typical application for state-machines
So as a rough picture the functionality of your code looks like this