![]() |
Solenoid Code Does Not Work!
We are using 12volt solenoids hooked up through the solenod break out. Everything in the code so far works besides the solenoids. The lights on the module don't light up either. The solenoids work and the pistons fire when the buttons are pressed manually.
Quote:
|
Re: Solenoid Code Does Not Work!
You posted long code without indentation. Use the "#" button the next time. I didn't look through the entire code because of the readability but for the first mistake, you were creating six solenoids on the same DO channel (channel 1)???
|
Re: Solenoid Code Does Not Work!
well, thats embarrasing... sorry
also, thanks for the tip on posting code Edit: if i repost the code with proper format would you mind giving it a look over for any other obvious mistakes? |
Re: Solenoid Code Does Not Work!
I suppose that also explains the error:
Quote:
|
Re: Solenoid Code Does Not Work!
Yep.
|
Re: Solenoid Code Does Not Work!
My code with formatting preserved:
Code:
#include "WPILib.h" |
Re: Solenoid Code Does Not Work!
Assuming your code is reflecting the connection of channels accurately, the code looks find. However, without knowing what the solenoid configurations are, I would guess there is one more mistake.
Code:
if (stick->GetRawButton(1) && !btn1state) //button is pressed but not being held |
Re: Solenoid Code Does Not Work!
ooh, nice catch, thank you.
Gah still 12hours till i can test my code again! |
Re: Solenoid Code Does Not Work!
also, one of the simplest ways to mess up that pneumatics board is double checking that it's in slot 8 on the CRIO and using the constructor that specifies slot as well as channel, for code clarity mostly.
|
| All times are GMT -5. The time now is 13:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi