|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Error with joystick controller and driver station
Are they in port 0 and 1 in the SmartDashboard as we? (Inside the driver station go to USB Devices and check the numbers to the left of the joysticks highlighted green).
|
|
#2
|
||||
|
||||
|
Re: Error with joystick controller and driver station
as well*
|
|
#3
|
|||
|
|||
|
Re: Error with joystick controller and driver station
Yep, I already try the port 0 and 1 and the joystick is turning green at the driver station whenever i press it
|
|
#4
|
|||
|
|||
|
Re: Error with joystick controller and driver station
You have a while(true) in your teleopPeriodic() method. You should do that in an IterativeRobot implementation. Try changing:
Code:
@Override
public void teleopPeriodic() {
while(true) {
robotDrive1.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
robotDrive2.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
gearMotor.set(rightJoystick.getY()*gearMotorSpeed);
if(rightJoystick.getRawButton(4)) {
fuelGate.set(1.0*fuelGateSpeed);
} else if(rightJoystick.getRawButton(5)) {
fuelGate.set(-1*fuelGateSpeed);
} else {
fuelGate.set(0);
}
if(rightJoystick.getRawButton(6)) {
scissorLift.set(1.0*scissorLiftSpeed);
} else if(rightJoystick.getRawButton(7)) {
scissorLift.set(-1*scissorLiftSpeed);
} else {
scissorLift.set(0);
}
}
}
Code:
@Override
public void teleopPeriodic() {
// teleopPeriodic() should do something and exit right away (it should not loop forever)
// while(true) {
robotDrive1.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
robotDrive2.arcadeDrive(leftJoystick.getY()*driveBaseSpeed, rightJoystick.getX());
gearMotor.set(rightJoystick.getY()*gearMotorSpeed);
if(rightJoystick.getRawButton(4)) {
fuelGate.set(1.0*fuelGateSpeed);
} else if(rightJoystick.getRawButton(5)) {
fuelGate.set(-1*fuelGateSpeed);
} else {
fuelGate.set(0);
}
if(rightJoystick.getRawButton(6)) {
scissorLift.set(1.0*scissorLiftSpeed);
} else if(rightJoystick.getRawButton(7)) {
scissorLift.set(-1*scissorLiftSpeed);
} else {
scissorLift.set(0);
}
// Removal of while(true) loop
// }
}
Paul |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|