|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Using Switches in Autonomus
How do I, using labView, program switches attached to the drivers station to decide which autonomus mode is used?
Thanks in Advance. |
|
#2
|
|||||
|
|||||
|
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? |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
Re: Using Switches in Autonomus
Fixed that for ya
|
|
#5
|
||||
|
||||
|
Re: Using Switches in Autonomus
Could you explain what a pull-up resistor is and why you need it in this situation?
|
|
#6
|
|||
|
|||
|
Re: Using Switches in Autonomus
A pull-(up/down) resistor weakly pulls an input either high or low. This prevents the input from floating around randomly and gives it a "Unless you dictate otherwise, I am high (or low if it is a pull down)." If you've ever had a digital input "flutter" or be otherwise unreliable, you probably needed a pull-___ resistor.
|
|
#7
|
|||
|
|||
|
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 |
|
#8
|
||||
|
||||
|
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! |
|
#9
|
|||
|
|||
|
Re: Using Switches in Autonomus
Quote:
after seeing how other robots are placed.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. ![]() |
|
#10
|
|||||
|
|||||
|
Re: Using Switches in Autonomus
Quote:
|
|
#11
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using Limit Switches in LabVIEW | VeedotJaydot | NI LabVIEW | 2 | 14-02-2009 16:01 |
| Toggling boolean using 2 limit switches | Quarkster | NI LabVIEW | 2 | 02-02-2009 22:43 |
| Using Limit Switches with the Arm | iwin2000 | Programming | 3 | 18-02-2008 03:52 |
| Using Switches on the Operator Interface | CronosPrime1 | Programming | 41 | 16-02-2006 11:43 |
| using limit_switch_max/min in autonomus | CmptrGk | Programming | 4 | 11-02-2005 11:32 |