ES_ERROR
Description: used to indicate an error from the service
ES_INIT
Parameter: void
Description: used for transition from initial pseudo-state to state
ES_TIMEOUT
Parameter: index of the timer
Description: triggered when a timer runs out
ES_NEW_KEY
Parameter: void
Description: triggered when a new key is received
ES_TIMEOUT
Parameter: index of the timer
Description: triggered when a timer runs out
Primary PIC32
ES_START_WELCOMING
Triggered when the start button is pressed, then enter the welcoming state with audio, tail wagging, and eye animation.
ES_FAIL
Triggered when the 60 second master timer is timeout, actions not completed in 60 seconds
ES_GENERATE_NEW_TASK
Triggered when a single task is timeout (15 s) or a task is completed
ES_DOING_STUFF
Triggered whenever the user interacts with the cat (to prevent the cat from going into the inactive state)
ES_NIRVANA_REACHED
Triggered when the completed task number is the Nirvana state-required number. Perform Nirvana audio, tail wagging motion and eye animation
ES_TAIL_SET_SPEED
Sets the wagging speed of the tail to the parameter of this event
ES_TAIL_START_OSCILLATING
Starts oscillating the tail
ES_TAIL_MOVE_TO
Moves the tail to the parameter of this event (in degrees). Stops oscillating
ES_FEEDING_ACTIVATE
Triggered if the current task is feeding the cat, the indication LED will lit up.
ES_FEEDING_BEAM_BROKEN
Triggered when a token is inserted in the mouth and the IR beam broken.
ES_FEEDING_COMPLETED
Triggered when the IR beam is broken. Finish the feeding task and present corresponding audio, tail wagging and eye animation
ES_MOVE_TO
Moves the servo to the parameter of this event (in degrees)
ES_SET_SPEED
Sets the movement speed of the servo to the parameter of this event
ES_DISPENSE
Dispenses a chocolate
ES_HOURGLASS_START
Flips the hourglass and starts timing
ES_HOURGLASS_TIMEOUT
Event triggered when the hourglass runs out
ES_HOURGLASS_RESET
Event to ask to reset the hourglass
ES_HOURGLASS_RESET_COMPLETED
The hourglass has finished resetting and is ready to time again
ES_BUTTON_PRESSED
Button is constant off. Triggered when button is pressed, and input from low to high.
ES_BUTTON_RELEASED
Button is constant off. Triggered when pressed button is released, and input from high to low.
ES_EYES_SET_ANIM
Triggered when positive or negative action feedback, display corresponding animation pattern
ES_EYES_SCROLL
Posted after the ES_EYES_SET_ANIM to make sure that the display is updated, when finish update, the step in the animation increases
ES_PAWMOVING_ACTIVATE
Triggered if the current task is the cat pet you.
ES_PAWMOVING_BEAM_BROKEN
Triggered when the IR beam is broken by hand putting in the designated area and return high voltage
ES_PAWMOVING_BEAM_RESTORED,
Triggered when the beam is restored after it is broken. Return voltage from high to low.
ES_PAWMOVING_COMPLETED
Triggered when the beam is broken continuously for a petting time within the task timer and present corresponding audio, tail wagging and eye animation
ES_PETTING_ACTIVATE
Triggered when petting task is activated and send the corresponding signal to Secondary PIC for audio.
ES_PETTING_COMPLETED
Triggered when petting action achieve the goal within a task timer. Perform corresponding audio, tail wagging and eye animation
ES_PLAY_AUDIO
Triggered whenever task starts or finish, send the corresponding pulse signals to the second PIC32
Secondary PIC32
ES_NEW_SIGNAL
Triggered when the decoding service finishes receiving a signal. The parameter is the data received, corresponding to a song to play or commands to control the LEDs or the audio player.
ES_FINISH_PLAYING
Triggers when the ACT pin changes from low to high.
ES_RISING
Triggered when sensing the rising edge of signals. The input from Primary from low to high voltage. The event parameter is the current time of rising edge.
ES_FALLING
Triggered when sensing the falling edge of signals. The event parameter is the current time of the falling edge. Calculate the pulse width and identify pulse number.