The Master Service manages the primary state of the game, including determining when the game starts and ends, as well as controlling indications of the game outcomes
Count the coins inserted and start the game
Determine the primary state and post the event to other services
End the game if the user remains idle for more than 20 seconds
The Button Checker handles player inputs, monitoring actions such as coin insertion and the pressing of the left and right buttons
Post COIN_INSERT when IR coupler is blocked
Post RAW_RIGHT_DOWN and RAW_RIGHT_UP events when the right button is pressed and released, respectively
Post RAW_LEFT_DOWN and RAW_LEFT_UP events when the left button is pressed and released, respectively
The Debouncing Service processes raw button inputs, stabilizing the signals to ensure more reliable communication with the Crew Service
Post RIGHT_DOWN and RIGHT_UP events when the right button is pressed and released, respectively
Post RIGHT_DOWN and RIGHT_UP events when the right button is pressed and released, respectively
The Crew Service receives inputs from the Debouncing Service (debounced button input) and the microphone's analog input to calculate the crew's speed and position, then posts this data to the Servo and LED Service
Use button inputs to determine the crew's movement direction and position
Use the analog microphone input to update the movement speed
Update the crew's position and send the data to the Servo and LED Service
The Servo Service receives the crew position and current tilting angle to update the next position of spaceship
Update spaceship tilting angle
Post LOSE event when tilting angle exceed win/lose threshold
The LED Service manages the LED matrix display, showing the crew's position and game outcomes
Display the crew's position on the LED matrix
Show indications of the game results
Display a welcome message before the game starts