![]() |
Limit Switch Programming Help (Have almost all of it figured out)
We have set up our robot exactly how you did this, wiring wise and then we had setup our limit switch exactly how the frcmastery.com video said to do it.
How we have our robot setup. - a kicker is pulled back(by a victor) until limit switch is pushed - victor then reverses until a limit switch 2 is pushed - then waits for a button to be pushed (and the kicker is released.(this is irrelevant)) We can't get step 1 to even happen. From everything we have looked up it looks good multiple tutorials past examples above examples. The only thing different that we just found out is that we don't have a DIO Module set up in the programming. At the moment programming is unable to edit the robots code? |
Re: Limit Switch Programming Help (Have almost all of it figured out)
The last time I played around with one of the limit switches in our room, I found out that the switch will continuously output 1 if its NOT pressed. As soon as it is pressed, it will output 0. (I use C/C++)
So what I did was, DigitalInput switch; // A variable that will get a value of 1 or 0 depending on the limit switch... then swich(13), // The port id it uses then in the Tele op continuous, if button 2 is pressed then turn the motor in the + direction or else, just stop the motor I am pretty sure that if you use a code like that, you wont need the second limit switch. (if I am correct as to why you have it) Now, you can convert this pseudo code into any programming language!! Good Luck, I hope this helped! |
Re: Limit Switch Programming Help (Have almost all of it figured out)
Does the limit switch need to be told the DIO Channel and the DIO Module?
or just the DIO Channel(In programming of course) I believe we have been doing it right as far as the wiring goes. We're using black and white. White on the side tab and black on the NC or NO. |
Re: Limit Switch Programming Help (Have almost all of it figured out)
When I did it, I just gave the pin # in my code, the port on the sidecar that get the single PWM from the limit switch.
eg. limitswitch(13), ~ Priyank PS. Sorry, I don't know the "proper name" of those pins on the sidecar. :o |
Re: Limit Switch Programming Help (Have almost all of it figured out)
Quote:
This is how you declare it. Quote:
|
| All times are GMT -5. The time now is 12:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi