|
Re: Spike relay help
Thanks for posting more of your code.
I do not see any obvious errors with your code. But I would do the following in your code:
1. Change kOn to kForward
2. Post what joystick model you are using, and ensure you are pressing the correct button.
3. Add print statements to your code so you can see if you are pressing the proper button
for example:
Code:
if (leftStick.getRawButton(1) == true)
{
spike.set(Relay.Value.kOn);
System.out.println("Button 1 Pressed, Relay LED should be Green");
}
else
{
spike.set(Relay.Value.kOff);
System.out.println("Button 1 Not Pressed, Relay LED should be Orange");
}
Then check the wiring and answer the following questions here so we can help you further:
1. Make sure you plugged your spike in to relay channel 1 of the DSC. Are you using a 4 slot cRIO or an 8 slot? \
2. Does the DSC have its 12V and 5V power leds lit up?
3. Does the joystick drive commands work when button 2 is pressed?
4. Ensure that you are enabling the robot in Teleop mode from the driver station.
5. What is the color of the Relay LED when you enable the robot?
6. Post the print output of the code from above
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner
|