![]() |
PROGRAMMING HELP PLEASE !
1 Attachment(s)
Hello,
My name is DeAndre and I was wondering if someone could possibly tell me what is wrong with my code: We have two Limit Switches on our Robot: Limit Switch 1: When hit reverses Kicker Motor . Limit Switch 2: When hit stops the Kicker Motor . Limit Switch 1 is in front of Limit Switch 2 . And also the Kicker Motor is attached to Button 1 on the joystick . So when we press Button 1 it enables the Kicker Motor to move forward, then when it hits Limit Switch 1 it automatically reverses to consequentially hit Limit Switch 2 and stop. Then it should automatically reset it self back to its original state. (Hope I provided enough description) Attached is our Teleop.vi ! |
Re: PROGRAMMING HELP PLEASE !
1 Attachment(s)
Here is also a picture !
|
Re: PROGRAMMING HELP PLEASE !
I would highly recommend checking out the FRC mastery site, especially the section on state machines http://frcmastery.com/try-me/state-machines/. The provided example is very similar to the method you are describing.
I hope this helps |
Re: PROGRAMMING HELP PLEASE !
I think that you are encountering a problem because you are referencing the motor power three times with different 'set speed' VIs and are hitting some sort of race condition.
One thing that is not obvious is that the case statement can accept numeric inputs as well as Boolean inputs. An 'easy' way to make a case statement that takes multiple booleans and does different things when they are set is to make a case statement and build an array of your booleans using 'build array'. You can then wire the boolean array to "boolean array to number' operator and wire the output of that to your case statement. Then you just need to use boolean math and put a motor speed value in each case. 00=0 -> (FF= case 0) 01=1 -> (FT= case 1) 10=2 -> (TF= case 2) 11=3 -> (TT= case 3) So there you have 4 different values with two boolean inputs and you can just use one "motor set speed" vi. Hope this is clear I don't have labview available at the moment or I'd take a screen shot. Regards, Sten |
Re: PROGRAMMING HELP PLEASE !
Also check the "Limit 1" string fed into the RefNum Registry Get.vi
You have two (2) spaces between "Limit" and the "1". If that is the way you set it up in your Begin VI then you are OK But if it is different that will cause you problems |
Re: PROGRAMMING HELP PLEASE !
2 Attachment(s)
This is what Sten is talking about.
|
Re: PROGRAMMING HELP PLEASE !
1 Attachment(s)
I believe I am trying to accomplish the same thing. I have 2 normally open switches which should turn off the relay motor once a true is recieved, which will be turned to a false, which is combined with a true from the joystick in a XOR (Not Exclusive Or) which will return false, which will turn it off. By default with nothing touching the buttons or switches, the relay should all be off, right?
Thanks |
Re: PROGRAMMING HELP PLEASE !
1 Attachment(s)
Let me restate what I think you want
IF Button 1 is pressed .AND. limit switch 1 is .NOT. true then run forward else IF button 2 is pressed .AND. limit switch 2 is .NOT true then run rev. else Stop |
Re: PROGRAMMING HELP PLEASE !
Exactly
|
Re: PROGRAMMING HELP PLEASE !
that's right
|
Re: PROGRAMMING HELP PLEASE !
PLEASE HELP robot is due in 3 hours, and our C-Rio isnt communiting!!!!
WE TRIED WIRELESSLY USING THE ROUTER, WITH THE IP : 10.15.15.10, SUBNET: 255.0.0.0 GATEWAY 10.15.14.4 PLEASE HELP!!! IS SOMETHING WRONG PLZ ONLY 3 HOURS LEFT HELP IS MUCH AP[PRECIATED |
Re: PROGRAMMING HELP PLEASE !
are you sure your ip addresses were correct? what you posted is 10.15.15.10
and 10.15.14.4, right? check the third set of numbers, they should be the same. can someone please answer my problem now? |
Re: PROGRAMMING HELP PLEASE !
yes i have:Classmate :
IP: 10.15.14.10 SUBNET 255.0.0.0 GATEWAY: 10.15.14.4 |
Re: PROGRAMMING HELP PLEASE !
Are the bridge(robot) and router(DS) correct?
|
Re: PROGRAMMING HELP PLEASE !
DENINATELY (dont mind my spelling only got 1 hour till robot due )
we had it working like 3 hours ago. SUDDENLY STOPPED!!! |
| All times are GMT -5. The time now is 18:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi