The requirement is for a software system that will manipulate the hardware for traffic control located at an intersection. The hardware includes a set of sensors, the traffic lights, and the control box. The software reads the state of the sensors, determines the new state for the intersection, and signals the lights to change. In addition, the system is to have other capabilities such as a test option which cycles the lights through the set of configurations. The system can also be set to a default state which might be flashing yellow in one direction and red in the other. The sensor indicates the presence (or absence) of a vehicle in a particular lane. There are several kindsof sensors, Mach of which works differently internally. All the sensors however are interrupt-driven and a bit is set whenever the sensor is tripped. After the decision to change the state of the intersection, every sensor is reset. This particular intersection uses two kinds of traffic lights. One is the usual three color light which is used for the go-straight lanes. The other light is a four position light: red, yellow, green, and turn arrow. Each light has a current state, a set of valid next states, and a default state. The controller physically contains the switches for the lights, the data stores for the sensors, and a clock for timing the state of the poll/decision cycle. The controller software reads the clock, polls the sensors, determines the next state, and sends the signals to change the lights.