#ifndef BumpTapeDetection_H #define BumpTapeDetection_H //typedefs typedef enum { TeamRed, TeamGreen } TeamColor_t; //Public function prototypes /**************************************************************************** Function BumpTapeInit Description Port initialization for the module. ****************************************************************************/ void BumpTapeInit(void); /**************************************************************************** Function ReadColor Returns Team color based on Team Color Switch. Description Checks team color switch and sets rope lights based on switch setting ****************************************************************************/ TeamColor_t ReadColor(void); /**************************************************************************** Function TurnOnLEDs Description Turns on both colors of rope lights (for debugging). ****************************************************************************/ void TurnOnLEDs (void); /**************************************************************************** Function ReadHalfCourt Returns 1 if switch is set to half-court mode, 0 otherwise. Description Checks Half Court Switch ****************************************************************************/ unsigned char ReadHalfCourt(void); /**************************************************************************** Function CheckBumpSensors Returns 1 if there has just been a bumper depressed, 0 otherwise Description Checks for a new bump event ****************************************************************************/ unsigned char CheckBumpSensors(void); /**************************************************************************** Function CheckForBall Returns 1 if there is a ball at gate (for DEBOUNCE_TIME), 0 otherwise. Description Checks tape sensor to see if a ball is at gate ****************************************************************************/ unsigned char CheckForBall(void); /**************************************************************************** Function ClearFrontTapeCache / ClearBackTapeCache Description Clears tape cache so we can check for a new tape event. This is a public function so that the cache can be cleared at any desired time. ****************************************************************************/ void ClearFrontTapeCache(void); void ClearBackTapeCache(void); /**************************************************************************** Function CheckFrontTapeCache / CheckBackTapeCache Returns 1 if the cache is full, and has not been checked before. 0 otherwise Description Checks whether all front or all back tape sensors have been triggered since last check. ****************************************************************************/ unsigned char CheckFrontTapeCache(void); unsigned char CheckBackTapeCache(void); #endif