Skip to content

Instantly share code, notes, and snippets.

#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;
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,