0% found this document useful (0 votes)
74 views1 page

Encoder Service State Machine

This document describes an encoder service state machine that controls a flywheel and ball release mechanism. It checks for events from a shooting state machine requesting to turn the flywheel on or off, release a ball, or close the ball gate. Depending on the event, it will start or stop the flywheel, set the ball gate servo to release or close the ball, and track the flywheel RPM.

Uploaded by

api-350941923
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views1 page

Encoder Service State Machine

This document describes an encoder service state machine that controls a flywheel and ball release mechanism. It checks for events from a shooting state machine requesting to turn the flywheel on or off, release a ball, or close the ball gate. Depending on the event, it will start or stop the flywheel, set the ball gate servo to release or close the ball, and track the flywheel RPM.

Uploaded by

api-350941923
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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