Go to Post There really is nothing else that needs to be said. - billbo911 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-02-2013, 10:53
Mubtasim Mubtasim is offline
Registered User
FRC #4797
 
Join Date: Feb 2013
Location: NY
Posts: 10
Mubtasim is an unknown quantity at this point
Compressor is not working

We are having a problem with the compressor
The spike relay is orange; selenoid is communicating but the compressor never starts??
heres the code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Jaguar;



public class RobotTemplate extends SimpleRobot {
private RobotDrive robotDrive = new RobotDrive(10,9);
private Joystick Stick = new Joystick(1);
private Jaguar Shooter = new Jaguar(5);
private Jaguar Loader = new Jaguar(6);
private Compressor compressor = new Compressor(2,2);
private Solenoid pistonUp = new Solenoid(1);
private Solenoid pistonDown = new Solenoid(2);
//Relay spikeRelay;
//private Relay spikeRelay = new Relay(2);

// public void robotInit() {

//spikeRelay = new Relay(2);}

public RobotTemplate() {
getWatchdog().setExpiration(0.5);
//spikeRelay.set(Relay.Value.kOn);
compressor.start();
//compressor.setRelayValue(Relay.Value.kForward);
}

public void operatorControl() {
getWatchdog().setEnabled(true);
while (isEnabled() && isOperatorControl()) {

getWatchdog().feed();
// robotDrive.setSafetyEnabled(false);
robotDrive.arcadeDrive(-Stick.getX(), Stick.getY());
robotDrive.setInvertedMotor(RobotDrive.MotorType.k RearLeft, true);


//spikeRelay.set(Relay.Value.kForward);



if (Stick.getTrigger()) {
pistonUp.set(true);
} else if (Stick.getRawButton(3)) {
pistonDown.set(true);
} else {
pistonUp.set(false);
pistonDown.set(false);
}
}

if (Stick.getRawButton(2)){
Shooter.set(.75);
} else {
Shooter.set(0);
}
if (Stick.getRawButton(5)){
Loader.set(.75);
} else {
Loader.set(0);
}
}

}
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 08:29.

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