$24
1) Buttons are connected to PA0 and PA1. Output PORTC and PORTD drive the LCD display, initially displaying 0. Pressing PA0 increments the display (stopping at 9). Pressing PA1 decrements the display (stopping at 0). If both buttons are depressed (even if not initially simultaneously), the display resets to 0. If a button is held, then the display continues to increment (or decrement) at a rate of once per second. Use a synchronous state machine captured in C.
2) **(Challenge)** Extend the earlier light game to maintain a score on the LCD display. The initial score is 5. Each time the user presses the button at the right time (the middle LED), the score increments. Each time the user fails, the score decrements. When reaching 9, show victory somehow.