Yiwen Wu
Engineer · Designer · Baker · Traveler
Project Homepage
Electrical System
Mechanical System
Silent Disco Software System
Button State Machine
When the start button is pressed, the ART exits Standby state. Button events are ignored in Running and Ending state.
Music State Machine
The music state machine is initiated only once when the ART is first powered on and enters Standby state. When start button is pressed, it enters Startup state and a welcome music is played in the headphones. 5 seconds later when the startup timer expires, it enters Running state and a theme music (2 overlay tracks) is played in the headphones. The speed of each track changes independently based on the corresponding IR sensor output value (0~99). The higher the sensor output value is, the faster the track plays. When the 45 second timer expires, it enters Ending state and an ending music is played in the headphones. 5 seconds later, the fanfare timer expires, music stops playing in the headphones, and it returns to Standby state.
LED State Machine
The LED state machine is initiated only once when the ART is first powered on and enters Standby state. In the Standby state, the timing LEDs turn on one at a time from left to right then right to left, repeating back and forth, controlled by the twinkle timer. The start button LED is on in Standby state. When start button is pressed, start button LED turns off and headphone LED turns on, prompting users to put on the headphones. 5 seconds later, it enters Running state. All 15 timing LEDs turn on (5x green, 5x yellow, 5x red). Every 3 seconds, a timing LED turns off and eventually after 45 seconds, all timing LEDs turn off. It enters EndingLEDs state and the timing LEDs twinkle controlled by twinkle timer. 5 seconds later, it returns to Standby state. In the Running state, if users have no interaction with the ART for 30 seconds, it returns to Standby state.
Motor State Machine
The motor state machine is initiated only once when the ART is first powered on and enters MotorsStandby state. After the start button being pressed and start up timer expires, it enters MotorsRunning state. It returns to MotorsStandby state after 45 seconds. If users have no interaction wit the ART for 30 seconds, it returns to MotorsStandby state.
Sensor State Machine
The sensor state machine is initiated only once when the ART is first powered on and enters Standby state. After the start button being pressed and start up timer expires, it enters Sampling state. It samples both sensors' inputs every time sample timer expires. It converts the sensors' inputs to values between 0 to 99 and posts the values to the motor state machine and the music state machine to control the motors and the music. After 45 seconds, it enters Ending state and stops sampling. 5 seconds later, it returns to Standby state. If during Sampling state, users have no interaction with the ART for 30 seconds, it returns to Standby state.