/**************************************************************************** Template header file for Hierarchical Sate Machines AKA StateCharts */ #ifndef TopHSM_H #define TopHSM_H #include "ES_Types.h" // Parameters For Tape Sensors Software Hysteresis #define redMin 160//500mV #define redMax 256//1000mV #define blackMin 700// 4V #define blackMax 1024//5 //Control Constants #define Kp 4 #define Ki 0.3 //Motor Speed and Distance #define TURN_NINETY_TICKS 74 #define FULL_SPEED_RPM 27 #define JOUST_RPM 20 #define HALF_SPEED_RPM 10 #define DEFINITE_DISTANCE_RPM 8 #define SHORT_TICKS 23 #define LONG_TICKS 125 #define fieldDistanceTicks 800 //Shooter Motor Control Speed #define ShooterPeriod 60 // State definitions for use with the query function typedef enum {TestingStage, Waiting, Stage1, Stage2, Stage3, Recess1, Recess2, Recess3, SuddenDeath, EndOfMatch} MasterState_t ; // Public Function Prototypes ES_Event RunMasterSM( ES_Event CurrentEvent ); void StartMasterSM ( ES_Event CurrentEvent ); bool PostMasterSM( ES_Event ThisEvent ); bool InitMasterSM ( uint8_t Priority ); MasterState_t QueryMasterHSM ( void ); bool DarkNightPlayer( void ); #endif /*TopHSM_H */