TrafficControl
A functional part of a project for my Computer Science course during my 2nd year.
Context; the goal of the project was to program a simulation of a lighted intersection with an Atmel microcontroller. We divided every possible and safe situation where people could cross the intersection. Each of these situations were called 'states'. This piece of code determines what state was to come next, based on the presence of either cars or pedestrians.