|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
Relays only going backwards?
So we have one relay set on relay output 0, configured in both directions. We have boolean variables true if button 5 or 6 is held, respectively, and two while loops if those variables are true. In those loops, we have the relays set to trigger forwards or backwards, and when the code breaks out of those two loops, set back to off. The loop for backwards works perfectly; when I hold button 5, the relay triggers to go backwards. But button 6, when held, does nothing. We have stepped through the code with the debugger, and it's supposed to be setting the relay to forwards, but it does nothing. Help?
Our code is at https://github.com/caffeinatedDrummer/2151-Code |
|
#2
|
|||||
|
|||||
|
Re: Relays only going backwards?
Quote:
|
|
#3
|
||||
|
||||
|
Re: Relays only going backwards?
Everything looks fine in the code, but...
Have you verified that you are correctly detecting button 6? The debugger shows that you are in the correct loop when button 6 is held down? Can you tell us what the relay is controlling and show a picture of the wiring? |
|
#4
|
||||||
|
||||||
|
Re: Relays only going backwards?
Does the LED on the relay change when you command the relay in reverse?
|
|
#5
|
||||
|
||||
|
Re: Relays only going backwards?
Quote:
Quote:
Quote:
The relay is to control the motor for part of our arms mechanism. ![]() This is a photo of our electronics board. The spike I am pointing to is the one we wish to control. The spike on the right does not work properly and will be removed soon. |
|
#6
|
||||
|
||||
|
Re: Relays only going backwards?
I would like to update to say we have solved the problem. Our connections to the RoboRIO from the Spike were in backwards, enabling us to go backwards, but not forwards. Correcting the PWM connection to the RoboRIO has fixed the problem. I haven't yet seen any replies, so if anyone has suggested such a fix, thank you for noticing the problem before we did.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|