|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#2
|
||||
|
||||
|
Re: Controlling Autonomous GamePlan
I think this depends whether or not you have time to do a quick switch in your programming and re-download the code before a match, or you have to quickly switch tactics right away and it would be better to flip a physical switch. Which one are you talking about?
If you're talking about the first, here's how I would do it: Make a case structure and put the code for the different strategies of autonomous in the different cases. Wire up a constant or a dashboard control to the case structure to decide which strategy you want to use. Then before you download your preferred code, switch this constant or control to the case that you want. If you want something more immediate, there's a whole bunch of different ways for taking the value of a physical switch and using that to determine which case to do. Basically you read from that switch and change the case structure I was talking about depending on its value. Here's some ideas: -Throttle on the joysticks: On the new 2009 joysticks there is a throttle that can be used like a switch if you aren't using it already. This is handy because you don't have to wire anything else extra up to the robot. It is the up-down dial that's front and center. You can read it's value in the code and see if it's greater than or less than 0.5/the middle. This effectively means if it's up or down. Before the match, you can switch this throttle to the desired position. -Switch on the robot Go to Radio Shack, buy a switch. Mount said switch on robot. Wire said switch to the digital sidecar. Switch said switch before match. Test said switch in code and switch the case structure depending on its value -Switch on driver station Pretty much the same as above, but hook it up to a driver station digital input. Actually, I don't know if this will work because the driver station might not be able to send data to the robot during autonomous during an official match. Keep in mind it might be nice to put the different code in individual subVIs so that it's cleaner and the case structure isn't huge. Hope that helps! Please ask if you need something more specific concerning one of these options! |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Controlling | team 803 | Programming | 10 | 21-02-2006 13:56 |
| Controlling motors | railerobotics | Programming | 6 | 17-01-2006 17:17 |
| Problem controlling a servo | Entropia | Programming | 2 | 18-06-2005 18:36 |