-
Notifications
You must be signed in to change notification settings - Fork 17
Shifter
Shifters is a class used to shift the gears of the robot to either high gear or low gear. The robot moves faster in high gear than it would in low gear. There are two double solenoids acting as shifters for the two sets of wheels on Ratchet.
Shifter::Shifter(main_robot* r, uint8_t mod,uint32_t chanF,uint32_t chanR)
uint8_t mod
, uint32_t chanF
and uint32_t chanR
are values used to instantiate the DoubleSolenoid class. main_robot* r
is a pointer to robot so that we are able to call other methods from other classes.
void Shifter::shiftGear()
This method is a simple method to shift high when it's low and low when it's high. This simplifies the shifting process however it is unused because when buttons are held, enum values might be set before the shift actually completes and things will break.
void Shifter::setHigh()
This method sets gear to high.
void Shifter::setLow()
This method sets gear to low.
void Shifter::buttonHelper(void* objPtr, uint32_t button)
buttonHelper is called by every class that needs to be controlled somehow. SHIFT_LOW
and SHIFT_HIGH
are buttons that can be set in controls.h.