Multi-Autonomous programming using EasyC

I posted this earlier today as a response to another question asked about "[FONT=Tahoma]jumpers with robotc", which turned into a multi-autonomous Q&A. I apologize if you are reading this twice in both places, but I didn’t want this to get lost under the topic of the previous posts.[/FONT]

You can find an upload I made a couple of weeks ago that contains details as well as EasyC code on writing a multi-autonomous program for your competition robot. Multi-autonomous programming made simple My preference is to use limit switches rather than jumpers but that is certainly a matter of choice.

I would prefer using a potentiometer sensor, you can probably get around 5 different values by attaching a few posts around the pot. sensor, and then a bar on the axle that goes through it, and simply set the bar in between any of the posts to change between different autonomous codes, or programming skills code.

There are actually 3 programming templates provided that take you through the steps of using limit switches and/or a potentiometer. This will yeild you between 2 and 10 autonomous routines. If you just want 2 routines then a limit switch is easy enough to use. Above 4 routines you definately want to use a pot. With 3 or 4, I can go either way.

How do you anchor your switches in such a way that they can easily be switched to a stable “pressed” condition without adding too much mechanical complication? We always seem to have trouble finding places to “stash” extra doodads and sensors without having them get in the way of something mechanical.

you can use an elastic at the beginning of the match and it will make the switch stay down
this works well with bumper switches too

I highly recommend a pot with some numbers/lines drawn on it. We adjust it with a axle bent 90 degrees.

A bunch of “if” statements and you’ll have easily four autonomous modes. Last year, what we did was a left/right switch and a pot to determine which autonomous mode to run.

We have usually been able to find a place to mount a single limit switch with a bearing block that is used as the switch hold-down mechanism. Other times when we used 2 or 3 switches, we had to install an additional bar, angle, or chassis rail to accomodate it. Take a look at the photograph in the uploaded file that shows example of the limit switch mounting as well as the potentiometer.

Yesterday, to show off to a Virginia elected official we wanted to impress, I asked one of the students I mentor/coach to use a bank of 9 LEDs (inserted into the high #'ed I/O slots of the microcontroller) to report a pot’s position (rotation). In under 30 minutes he had it working like a charm. As we rotated the pots the LEDs lit up one at a time starting in slot 8 and ending in slot 16.

Any of the methods folks have described here will work just fine, but I thought this one was fun and reasonably idiot-proof; and it is good eye-candy. However, it’s drawbacks are that you need to set the pot while the robot’s software is running (i.e. using a tether before taking a crystal-controlled bot to the field); and you need to have enough free slots to cover all of your autonomous choices.

PS: Using the LEDs to display some fun patterns during autonomous or teleop would obviously be essential too :wink:

Team 10C, Exothermic Rick Astley, combines a pair of status lights with an important decorative element.