Smart traffic light project

wvmarle...

I'd quibble some of your code - for example you can't say

bool intersectionState and assign it a value of 4.

But in general a finite state machine is the correct approach to this type of problem, and once you've got the concept, leads to much more legible code.

OP - you've got lots to learn, and understanding FSM's is a great step forward to more complex programming, leading onto eg operating systems .

Keep at it!

Good luck.

Allan