Go to Post We're moving to metric, inch by inch. - Joe Ross [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 18-02-2012, 16:33
Twisted eric's Avatar
Twisted eric Twisted eric is offline
Registered User
FRC #0581
 
Join Date: Jan 2010
Location: San Jose
Posts: 54
Twisted eric is an unknown quantity at this point
Pneumatic Compressor not starting up Pneumatic Compressor not starting up

This is the third day I have been at this (working on pneumatics).

Now the compressor is attached to a spike, then the spike is connected to the power distribution board both 20amp breakers. The spike is connected to the digital sidecar in relay slot 1 (sig [a], pow[b], ground[-]). And the pressure switch is connected to Digital I/O 1 (Black on Nc, Red on C).

Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Watchdog;

public class RobotTemplate extends SimpleRobot {

    private static final long TIME_DELAY = 1000; //in milliseconds
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Joystick three = new Joystick(3);
    Jaguar rightF = new Jaguar(2);
    Jaguar rightB = new Jaguar(1);
    Jaguar leftF = new Jaguar(3);
    public Jaguar leftB = new Jaguar(4);
    public Compressor fluffy = new Compressor(1, 1, 1, 1);
    DriverStation ds;
    Watchdog fenrir = Watchdog.getInstance();

  

    void drive() {
        if (leftStick.getRawButton(1)) {
            leftF.set(-1.0);
            rightB.set(1.0);
            leftB.set(1.0);
            rightF.set(-1.0);
        } else {
            if (rightStick.getRawButton(1)) {
                leftF.set(1.0);
                rightB.set(-1.0);
                leftB.set(-1.0);
                rightF.set(1.0);
            } else {
                leftF.set(leftStick.getY());
                rightB.set(rightStick.getY() * -1);
                leftB.set(leftStick.getY());
                rightF.set(rightStick.getY() * -1);

            }
        }

    }

    void com() {
        fenrir.feed();
        if (fluffy.getPressureSwitchValue()) {
            fluffy.setRelayValue(Relay.Value.kOff);
        } else {
            fluffy.setRelayValue(Relay.Value.kOn);

        }
    }

    public void autonomous() {
        fenrir.feed();
    }

    public void operatorControl() {
        while (true && isOperatorControl() && isEnabled()) {
            fenrir.feed();
            com();
            drive();
        }
    }
}
Here is he code I went over a ton of times and can't see anything wrong with it. Help please.

I know its also in the pneumatic's thread but more people are viewing this thread.
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:49.

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