You are on page 1of 1

Encoder Service State Machine

ES_Event RunEncoderService( ES_Event ThisEvent )


{
// set return event type to ES_NO_EVENT; assume no errors

//if the Shooting state machine has requested that we turn on the flywheel
//start the flywheel
//turn off the stop flywheel flag

//if the Shooting state machine has requested that we turn on the flywheel
//stop the flywheel
//set the stop flywheel flag
//reset the currentRPM to be zero manually here
}
//if the Shooting state machine has requested that we release a ball into the flywheel to shoot
//set the servo duty to move the gate to the release ball position
// set timer ES_Timer_InitTimer(GATE_SERVO_TIMER, gateReleaseTime);
}
//if the servo has finished releasing the ball
//set the servo duty to move the gate to the closed position
}
//return the event and assume no errors
}

You might also like