void main_wheel( int joy1_x1, int joy1_y1 ) { int k=8; int drivePower = DEADBAND(joy1_x1/k); int turnPower = DEADBAND(joy1_y1/k); motor[motorA] = BOUND(drivePower - turnPower); motor[motorB] = BOUND(drivePower + turnPower); }
void main_wheel( int joy1_x1, int joy1_y1 ) { int drivePower = DEADBAND(joy1_x1); int turnPower = DEADBAND(joy1_y1); motor[LeftBase] = BOUND(drivePower - turnPower); motor[RightBase] = BOUND(drivePower + turnPower); }
task main() { while (true) { wait1Msec(LOOP_INTERVAL); getJoystickSettings(joystick); holoMove(remapJoystickInput(DEADBAND(joystick.joy1_x1)), remapJoystickInput(DEADBAND(joystick.joy1_y1)), remapJoystickInput(DEADBAND(joystick.joy1_x2))); //holoRotate(remapJoystickInput(DEADBAND(joystick.joy1_x2))); // Test Code to test if Joystick Controller input is working if (joy1Btn(4)) { writeDebugStreamLine("JOY4BUTTON"); //MissionImpossible(); } } }
void arm_motors( int joy2_y1 ) { int k=8; int rotatePower = DEADBAND(joy2_y1/k); motor[motorD] = -BOUND(rotatePower); }
void central_motor( int joy1_y2 ) { int k=8; int rotatePower = DEADBAND(joy1_y2/k); motor[motorC] = BOUND(rotatePower); }
void arm_motors( int joy1_y2 ) { int k=10; //bigger = slower int rotatePower = DEADBAND(joy1_y2); motor[motorD] = -BOUND(rotatePower/k); }
void central_motor( int joy1_x2 ) { int k=15; //higher = slower int rotatePower = DEADBAND(joy1_x2); motor[motorC] = BOUND(rotatePower/k); }
// This method moves each wheel independently, taking input from the respective joysticks void tank_drive(){ motor[leftMotor] = DEADBAND(vexRT[JOY_AXIS_LEFT]) * SLOW * REVERSE; motor[rightMotor] = DEADBAND(vexRT[JOY_AXIS_RIGHT]) * SLOW * REVERSE; }
void sync_arcade(){ motor[leftMotor] = (DEADBAND(vexRT[JOY_AXIS_LEFT]) + DEADBAND(vexRT[JOY_AXIS_TURN])) * SLOW * REVERSE; motor[rightMotor] = (DEADBAND(vexRT[JOY_AXIS_LEFT]) - DEADBAND(vexRT[JOY_AXIS_TURN])) * SLOW * REVERSE; }
/* * moveMotors * * Both the left and right motors are set to equal their respective joystick's * positions, times the constant move speed. */ void moveMotors(){ motor[leftMotor] = (DEADBAND(vexRT[JOY_BTN_LEFT]) * BTN_JOYSTICK_MOVE_SPEED); motor[rightMotor] = (DEADBAND(vexRT[JOY_BTN_RIGHT]) * BTN_JOYSTICK_MOVE_SPEED); }