Quote:
Originally Posted by 5339
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.