View Single Post
  #4   Spotlight this post!  
Unread 27-06-2014, 14:05
ccresta1386's Avatar
ccresta1386 ccresta1386 is offline
Registered User
AKA: Collin Cresta
FRC #4954 (Palindrome Robotics)
Team Role: Driver
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Middletown, DE
Posts: 24
ccresta1386 is an unknown quantity at this point
Re: First Year with Java, Help Requested

We are also in our first year and need help with programming. Our forward/backward and rotation works but strafing does not work.
Code:
 
    drive = new RobotDrive(1, 3, 2, 4); 
    driverStick = new Joystick(1);
    shooterStick = new Joystick(2);
    robotHeadingGyro = new Gyro(1);


double rotation = driverStick.getZ()*-1 / 2;                                                if (driverStick.getRawButton(3)){
rotation += .4;
 }else if(driverStick.getRawButton(4)){
rotation += -.4;
      }
               
drive.mecanumDrive_Cartesian(driverStick.getX(),
rotation,
driverStick.getY()*-1,
0);// we plan on putting a gyro in when the strafe works
Reply With Quote