//Rotates a motor forward and backward using the square button //Can be used in mechanisms such as a gripper/claw and projectile “kicker” //Fill variable “pressures.square” into respective field //Boolean variables "closed" and "valid" are instantiated outside of function //as doing so within while loop resets the respective states each iteration bool closed; bool valid; void doUndo(int square){ if(square == 100 && !valid){ valid = true; if(!closed){ closed = true; RotateMotor(OUT_A, 75, -50); }else if(closed){ closed = false; RotateMotor(OUT_A, 75, 50); } }else if(square == 0 && valid){ valid = false; } } //Rotates a motor continuously CW or CCW if holding a particular shoulder button //Can be used in mechanisms such as a projectile “kicker” //Insert variables “pressures.r2” and “pressures.l2” into respective fields void continuousRotation(int rightBumper, int leftBumper){ if(rightBumper == 100){ OnFwd(OUT_A, 80); }else if(leftBumper == 100){ OnRev(OUT_A, 80); }else{ Off(OUT_A); } }