/**************************************************************************** Module ColorService Private Definitions MyPriority X coordinate array Y coordinate array MyLocation PrevTile Samples Array bool InitColorService (uint8_t Priority)------------------------- // Set MyPriority to Priority //post the intial transition event //return bool bool PostColorService (ES_Event_t ThisEvent)---------------------- // return result of ES_PostToService ES_Event_t RunColorService(ES_Event_t CurrentEvent) ---------------------- // set Prev1 and Prev 2 to error // based on our current state: // if current state is ES_INIT // start 1 second timer // if current state is ES_TIMEOUT // initialize 250 ms timer for I2C test timer //read RBG values from color sensor // iterate through samples array to find closest color by euclidean distance // If it's not white or black and it's consistent with the previous two readings // record it as current tile // compare it with previous tile // if it's different, post NewColor to PostMasterSM // update previous tiles // update previous values // return ReturnEvent uint8_t getX(void)--------------------------------------------------- // return xcoordinate at index MyLocation uint8_t getY(void) { // return ycoordinate at index MyLocation