View Single Post
  #1   Spotlight this post!  
Unread 21-07-2014, 14:30
5339 5339 is offline
Registered User
FRC #5914
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2104
Location: Caledonia, minnesota
Posts: 9
5339 is an unknown quantity at this point
Spike relay help

Here is our program part for the spike but it doesn't work. Why?
It says there are no errors.

package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Relay;

import edu.wpi.first.wpilibj.SimpleRobot;

public class RobotTemplate extends SimpleRobot {
public Joystick leftStick = new Joystick(1);
public Victor leftDrive = new Victor(1);
public Victor rightDrive = new Victor(2);
public Jaguar middleDrive = new Jaguar(3);
public Relay spike = new Relay(1);

public void autonomous() {
}

public void operatorControl() {
while (isOperatorControl() && isEnabled()) {

{if (leftStick.getRawButton(1)== true) {
spike.set(Relay.Value.kOn);
}
else {
spike.set(Relay.Value.kOff);}}

{if (leftStick.getRawButton(2)== true) {
leftDrive.set((leftStick.getX()+ leftStick.getY()));
rightDrive.set((leftStick.getX()- leftStick.getY()));

}else{
leftDrive.set(0);
rightDrive.set(0);
}}

}
} public void test() {

}
}

Last edited by 5339 : 21-07-2014 at 18:41.
Reply With Quote