This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ENC_ERROR_THRESHOLD 3000 | |
int checkEnc = nMotorEncoder[curMotor]; | |
int knownGoodEnc = motorStates[curMotor].lastRealEncoderPos; | |
int curEnc; | |
if (abs(checkEnc - knownGoodEnc) > ENC_ERROR_THRESHOLD) { | |
//do nothing because enc val is bad | |
} else { | |
curEnc = checkEnc; //enc val is good | |
motorStates[curMotor].lastRealEncoderPos = curEnc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
NO_BALLS, BIG_BALLS, ALL_BALLS, | |
} HarvestState; | |
typedef enum { | |
NO_BALLS, BIG_BALLS, ALL_BALLS, | |
} HarvestPreState; | |
typedef enum { | |
STOPPER_OPEN, STOPPER_CLOSE, WINCH_BIG_ALL, WINCH_BIG_START, |