Hey guys I am from team 5676 and we have a little or big problem with our arcade drive and the java program. We are using talon motor controllers with the kop andymark motors and pneumatic's. But we don't get it running. The robot is just turning around the y and at the x axes at option 1 but the pneumatic's are working. At option 2 is it not driving and the pneumatic's aren't working also but I thought that it would be he exact copy of the example but the code is getting permanently deployed at the roborio. Because an other problem is that at option 1 is the code stopping and getting periodically erased from the roborio at around 1;50 until I restart it. My first thought was that it's maybe running out of ram but that doesn't seem to be the problem.
Every help or input would be highly appreciated. I thank all of you in advance for your time and help.
option 1:
Code:
package org.usfirst.frc.team5676.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.RobotDrive;
public class Robot extends IterativeRobot {
RobotDrive myRobot;
Joystick stick;
DoubleSolenoid Piston;
public void robotInit() {
myRobot = new RobotDrive (0, 1, 2, 3);
stick = new Joystick(0);
}
public void autonomousPeriodic() {
}
public void teleopPeriodic() {
myRobot.arcadeDrive(stick);
Piston = new DoubleSolenoid (0,1);
if(stick.getRawButton(5)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(6))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff);
}
Piston = new DoubleSolenoid(2,3 );
if(stick.getRawButton(3)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(4))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff);
}
Piston = new DoubleSolenoid(4,5 );
if(stick.getRawButton(1)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(2))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff); }
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
}
}
option 2:
Code:
package org.usfirst.frc.team5676.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
public class Robot extends IterativeRobot {
RobotDrive myRobot;
Joystick stick;
DoubleSolenoid Piston;
public void robotInit() {
myRobot = new RobotDrive (0, 1, 2, 3);
stick = new Joystick(0);
}
public void autonomousPeriodic() {
}
public void teleopPeriodic() {
while (isOperatorControl() && isEnabled()) {
myRobot.arcadeDrive(stick);
Timer.delay(0.01);
}
Piston = new DoubleSolenoid (0,1);
if(stick.getRawButton(5)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(6))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff);
}
Piston = new DoubleSolenoid(2,3 );
if(stick.getRawButton(3)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(4))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff);
}
Piston = new DoubleSolenoid(4,5 );
if(stick.getRawButton(1)) {
Piston.set(DoubleSolenoid.Value.kForward);
System.out.println("'A' button is pressed: Piston moves forward");
}
else if(stick.getRawButton(2))
{
Piston.set(DoubleSolenoid.Value.kReverse);
System.out.println("'B' button is pressed: Piston moves backward");
}
else
{
Piston.set(DoubleSolenoid.Value.kOff); }
}
/**
* This function is called periodically during test mode
*/
public void testPeriodic() {
}
}