updated 7seg controls for new 7 seg boards
Dependencies: PixelArray WS2812 mbed
Fork of frdm_pong_table_controller by
Diff: main.h
- Revision:
- 9:f3f194982bb3
- Parent:
- 8:66dac2e00cce
- Child:
- 10:554301a1579b
--- a/main.h Tue Jul 11 08:51:23 2017 +0000 +++ b/main.h Tue Jul 11 13:02:44 2017 +0000 @@ -68,21 +68,26 @@ double prevPbbValue; // Previous player break beam value // FUNCTION DECLERATIONS -void Setup(); // initial pattern +void Setup(); void SetNumberPatterns(); // sets segment patterns for numbers void SetLEDArray(int x); // sets segment patterns in mainArray void WriteScores(); // writes scores to the LEDs void WritePxAnimation(int line_num,bool isRobot,bool colour); // writes mainArray to either LED buffer in blue or random colours +// Protocols for handling goals and whether the player or robot has won void HandleGoal(bool hasRobotScored); void HandleWin(); +// Animation for scoring a goal and winning the game void GoalAnimation(bool hasRobotScored); void WinAnimation(bool isRobotWinner); +// Decorative Animations void CircleAnimation(bool robot, bool robotColour,bool player, bool playerColour, int numberOfRepitions); -void DrainAnimation(bool robot, bool robotColour, int robotScore, bool player, bool playerColour, int playerScore); +void FigureOf8Animation(bool robot, bool robotColour,bool player, bool playerColour, int numberOfRepitions); +void DrainAnimation(bool robot, bool robotColour, bool player, bool playerColour); +// Animations for writing and deleting displayed numbers void ZeroInAnimation(bool robot, bool robotColour,bool player, bool playerColour); void ZeroOutAnimation(bool robot, bool robotColour,bool player, bool playerColour); void OneInAnimation(bool robot, bool robotColour,bool player, bool playerColour); @@ -92,6 +97,9 @@ void ThreeInAnimation(bool robot, bool robotColour,bool player, bool playerColour); void ThreeOutAnimation(bool robot, bool robotColour,bool player, bool playerColour); +// Protocol and transition functions for Idle and Play states +void IdleStateProtocol(); +void PlayStateProtocol(); void PlayToIdleTransition(); void IdleToPlayTransition();