Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Need help getting spike relays working (http://www.chiefdelphi.com/forums/showthread.php?t=103418)

kingpinzs 20-02-2012 18:37

Need help getting spike relays working
 
Code:

Relay hopper;

hopper(1);

if(joybutton(1));
{
  hopper.Set(Relay::kOn);
  hopper.Set(Relay::kForward);
}

It doesnt do anything at all.

How do I get the spike relays working to test?

DavisC 20-02-2012 19:59

Re: Need help getting spike relays working
 
Ok, for my code, I don't need the kOn at all.

Is the PWM wire properly plugged into the Relay side of the DSC instead of the PWM side?

Also when the button is pressed, what do the lights next to slot 1 of Relay do?

And do the lights on the Spikes change?

If the answer to the first 2 are yes, and the third no, try messing with the wire more (or a different 1).

SideNote:
WhooHoo, 100 posts!
And congrats on your 1st post!

kingpinzs 20-02-2012 20:38

Re: Need help getting spike relays working
 
1. Yes but both were tried
2. the lights don't even come on
3. the lights don't change

DavisC 20-02-2012 20:48

Re: Need help getting spike relays working
 
By any chance are the lights on the Relay side red by even when not enabled?
Also are all 3 green lights on the DSC?

kccowan 20-02-2012 23:42

Re: Need help getting spike relays working
 
Quote:

Originally Posted by kingpinzs (Post 1131150)
Code:

Relay hopper;

hopper(1);

if(joybutton(1));
{
  hopper.Set(Relay::kOn);
  hopper.Set(Relay::kForward);
}


Check out Relay.cpp in WPILib. Relay have a direction, kOn sets both forward and reverse. kForward sets only forward. If it was wired correctly, I'm guessing you want to remove the kOn call.

KC

Alan Anderson 21-02-2012 01:32

Re: Need help getting spike relays working
 
Relays won't do anything if the robot is disabled. Did you enable it from the Driver Station when you ran the test?


All times are GMT -5. The time now is 17:37.

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