![]() |
Using Switches in Autonomus
How do I, using labView, program switches attached to the drivers station to decide which autonomus mode is used?:confused:
Thanks in Advance. |
Re: Using Switches in Autonomus
As soon as the robot is enabled in autonomous mode, you won't be able to read anything from the Driver Station. So what you need to do is continuously read the switches while the robot is disabled, figure out which autonomous selection that means, and store it in a global variable. When autonomous begins, use the value from that global variable to select the proper actions.
Is that enough to start with, or do you want more detail? |
Re: Using Switches in Autonomus
Just a reminder that the DS inputs do not have pull-up resistors. So, you need to connect a pull-up from +5 to signal and a switch from signal to ground.
|
Re: Using Switches in Autonomus
Quote:
|
Re: Using Switches in Autonomus
Could you explain what a pull-up resistor is and why you need it in this situation?
|
Re: Using Switches in Autonomus
Quote:
|
Re: Using Switches in Autonomus
That being said vdubs you might want to let them know that a 10k resistor works perfectly (at least it did for us).
Dont want them to use a small resistor and end up shorting the DS |
Re: Using Switches in Autonomus
I like Alan's recommendation of using a global variable, but why not put the switches on the 'bot instead of the DS?
During the setup time between matches you place your 'bot and set your switches accordingly. We never actually implemented the full code last year, but we had some switches on the 'bot that we could set based on which starting square we were starting in. This way, the Auto code can know its starting position as soon as it starts up. Regrettably, our autonomous code never got that mature and the switches were left unused ... go figure! |
Re: Using Switches in Autonomus
Quote:
I think our programmer for 2009 even had a one-line autonomous description on the DS box, which was better than a simple number. Not that his descriptions were, well, descriptive. :p |
Re: Using Switches in Autonomus
Quote:
|
Re: Using Switches in Autonomus
Having the switched on the controls allows for last minute changes to the code in case of a strategy change - dont know how many times we've changed the auton after a brief stroke of inspiration 5 seconds before the match starts.
As for the DS display, I find that showing the position and the begining movement of the robot allows for the operator/driver/coach to identify the auton being used pretty well. For example, one of my codes displays: far left to far right, or center away. |
| All times are GMT -5. The time now is 20:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi