![]() |
Spike Relay works only in Reverse
Hi,
We want a button to start the relay in reverse, and one for it to go forward. We also have a button to make it stop. The problem is that the spike is only getting the signals to send it in reverse and to stop. our code for it is as follows: Code:
thanks, Mr. Stone |
Re: Spike Relay works only in Reverse
Does the Relay LED on the Digital Sidecar go green, red,and off when you push the buttons?
If those are not working either, then it's a coding problem. If those are working, then it's a Sipke problem. |
Re: Spike Relay works only in Reverse
The Led only works when I push it to reverse. It goes red.
Besides we tried a different Spike |
Re: Spike Relay works only in Reverse
Tracing backwards from the lack of green light on the Relay port, I don't see anything wrong with the code you posted. How is joyBtnShooter8Pushed being set?
|
Re: Spike Relay works only in Reverse
[code]
/////////////////////////////////////////////////////////////////////////// // Read the values of the joysticks and buttons on both operator pads. /////////////////////////////////////////////////////////////////////////// void ReadOperatorPads() { GetWatchdog().Feed(); joyYDriverLeft = operatorPadDriver->GetLeftY(); joyYDriverRight = operatorPadDriver->GetRightY(); joyBtnDriver1Pushed = operatorPadDriver->GetNumberedButton(1); joyBtnDriver2Pushed = operatorPadDriver->GetNumberedButton(2); joyBtnDriver3Pushed = operatorPadDriver->GetNumberedButton(3); joyBtnDriver4Pushed = operatorPadDriver->GetNumberedButton(4); joyBtnDriver5Pushed = operatorPadDriver->GetNumberedButton(5); joyBtnDriver6Pushed = operatorPadDriver->GetNumberedButton(6); joyYShooterLeft = operatorPadShooter->GetLeftY(); joyYShooterRight = operatorPadShooter->GetRightY(); joyBtnShooter1Pushed = operatorPadShooter->GetNumberedButton(1); joyBtnShooter2Pushed = operatorPadShooter->GetNumberedButton(2); joyBtnShooter3Pushed = operatorPadShooter->GetNumberedButton(3); joyBtnShooter4Pushed = operatorPadShooter->GetNumberedButton(4); joyBtnShooter5Pushed = operatorPadShooter->GetNumberedButton(5); joyBtnShooter6Pushed = operatorPadShooter->GetNumberedButton(6); joyBtnShooter7Pushed = operatorPadShooter->GetNumberedButton(7); joyBtnShooter8Pushed = operatorPadShooter->GetNumberedButton(8); joyBtnShooter9Pushed = operatorPadShooter->GetNumberedButton(9); [code] they are being set correctly because, we used that button earlier in our code to operate a solenoid, and it worked perfectly. EDIT: there is an error that comes up in the message log in the diagnostics tab of the driver station: "Fatal error "Attempting to reuse an allocated resource" in Allocate() in C:/WindRiver/workspace/WPILib/resource.cpp at line 79" I get this 6 times when the robot starts up. Also, when i put in a new command to make it go kForward, in the beginning of the loop "avoidtipover" It does nothing. it acts as if I set it to kOff. i can press down the btn9 and it will run but the second that I release it, it turns off. |
Re: Spike Relay works only in Reverse
Quote:
Code:
m_gyro = new Gyro(1); |
Re: Spike Relay works only in Reverse
thanks, as of writing this, we still cannot find the duplicate allocation, but our mentor will be arriving later today to help us out. thanks a lot.
P.S. finding and fixing the allocate error will most likely solve the original problem, because we are using a spike to operate our compressor. |
Re: Spike Relay works only in Reverse
I fixed it, the problem was that we were plugging the cable into the sidecar backwards. It figures that it was something stupid like that, and thanks for all the help.
|
| All times are GMT -5. The time now is 13:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi