Hey guys, I’ve had a very weird issue. I’ve been making a simple program that maps the motors of a drivetrain to joysticks, and then when a button is pressed, run one of the motors (very simple, I know).
The Joystick part would work fine, but when I would add in the button line, it either not work, or the joystick part would start bugging out (or not work entirely).
Any solutions? I’ve never experienced this before. Maybe a firmware update? Idk.
#include "robot-config.h"
int main() {
while(true){ //while loop (infinite)
// maps the controller axis to each motor, tank control
RearRight.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
FrontRight.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
RearLeft.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
FrontLeft.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
if(Controller1.ButtonB.pressing()){
FrontRight.spin(directionType::fwd, 50, velocityUnits::pct);
}
}
}