Go to Post We are here to support each other. - Mike Martus [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi