View Single Post
  #5   Spotlight this post!  
Unread 16-02-2013, 21:05
ClockworkPirate ClockworkPirate is offline
Registered User
AKA: Mario Guerrieri
FRC #0670 (Homestead Robotics Team)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Sunnyvale, CA
Posts: 2
ClockworkPirate is an unknown quantity at this point
Re: Using Spike Relays in Java?

I have a field in my Shooter class with a field Relay pneuRelay, which I initialize in Shooter's constructor with pneuRelay = new Relay(1); (we have a relay plugged into the first plug on the sidecar). I call
Code:
public void setForward()
{
    pneuRelay.set(Relay.Value.kForward);
}
on it, nothing happens.

There is kind of a bunch of abstracted stuff down to that "real" call, but nothing happens even when I put the call (new Relay(1).set(Relay.Value.kForward)) right in the constructor of our SimpleRobot subclass... It seems to me that either I'm not using the library right or the relay isn't wired correctly.

Here's Pastebins of my code if you still want to see it (this is with the port 1 initialization in the SimpleRobot constructor, so the one in Shooter.java is changed to 2 to avoid a conflict):
Robot2013.java (SimpleRobot subclass)
DriveStation.java (has Shooter, DriveTrain, etc objects, interprets joystick controls)
Shooter.java (controls the shooter motors, I'm trying to add the relay to control some related pneumatics)

Last edited by ClockworkPirate : 16-02-2013 at 21:20.
Reply With Quote