Programming for the first time.

I am using easyC and master ver7 4easyC is the right for program when going to competition? How do you program for autonomous period if you do not know witch position you will be in?:confused:

sounds like the right master code.
before each match, teams are allowed to position their robot any way they want, as long as some part of the robot, usually the wheels, is touching your color tile

It’s also a good idea to have a couple of different auto routines, and sometimes even to have red and blue versions. You can tell the robot which routine to run by plugging jumpers in the A/D ports and running them in code. In pseudo code it might work like this:

Run autonomous code
If jumper 1 = true then

[INDENT]< do auto 1 >

else if Jumper 2 = true then

< do auto 2 >

else if Jumper 3 = true then

< do auto 3>[/INDENT]

End If loop

End autonomous task


This will, of course, look different in C. There are more elegant ways to handle this, but this will work and is easy to learn. Good luck!

depending on how you situate that, having an all in one program like that can be pretty big, and have some consequences. i dont know what those consequences are exactly, though

It’s all a trade-off. Keeping stuff in one mainline thread is against normal programming practices for 2009, but these little microcontrollers don’t have a lot of resources. If you create too many functions you can have code that gets compile errors. As long as it doesn’t get too big, having your code in one main line is fine. Most Elevation auto I’ve seen consists of ā€œraise the arm, move forward, turn the belts on.ā€ About four lines of code does it.

Jumpers will work for this, but I like to use limit switches with a rubber band. If it is open or closed it will do a different autonomous. I think it is much easier to change very quickly and often times easier to access than the interrupt ports.