View Single Post
  #4   Spotlight this post!  
Unread 21-07-2014, 14:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Spike relay help

Quote:
Originally Posted by 5339 View Post
Here is our program part for the spike but it doesn't work. Why?

if (leftstick.getRawButton(1) == true) {
spike.set(Relay.Value.kOn;
Timer.delay(.1);
}
else {
spike.set(Relay.Value.kOff);}
Why do you think it doesn't work? Does the Spike LED change between yellow/orange and off? Do the red and green relay status LEDs on the Digital Sidecar both go on, then both go off?

The kOn constant sets both M- and M+ outputs of the Spike to battery voltage. Depending on what you have connected to it, that probably won't do what you want. Instead, use kForward. That will set M+ to battery and M- to "ground", powering whatever is connected between them.
Reply With Quote