
And you have some pins to spare, so you could make a traffic light for both directions of an intersection. (With proper delays/safety times between the green phases for either side.) Or use one pin as an analog input to adjust the cycle time. Or cater to European tastes and implement a "red, red/yellow, green, yellow, ..." cycle. Or use two pins as a sensor input and a trigger output for a red-light camera.
Microcontrollers are neat; loads of flexiblity in small, simple and cheap packages.
