Hi there teams!
We, MegaBotz, were battling to figure out how to get the Autonomous and Tele-op modes to work – both templates in RobotC looked the same to us and we were lost. We contacted a team from the US, Cafebots and they were super eager to help us with our problem. Brandon sent us the following and I am sure it will help all of you as well : (The Program-Chooser.c file can be downloaded here)
For the Autonomous and Teleop programs, you can use either one file (with both programs in it) or two files. Our team prefers to use two files, titled Teleop.c and Autonomous.c respectively, so I will proceed along that train of thought.
In the two file case, both files use an identical template, just with different code after the waitForStart() function:
Once you have these two files created and compiled, you will need to download a third file to your robot called Program-Chooser.c. It’s supposed to be included with RobotC, but even the veteran teams were having trouble finding where it was located (File can be downloaded at the top of this discussion)
Once this file is downloaded to your robot, run it on the NXT manually.
With that, you should be all set for competition! When you place the robot out on the field, select and start running the Autonomous program first; the FCS will automatically stop it and start the Tele-Op program at the end of Autonomous. You should re-select the Tele-Op file on the NXT every time you change it, just to be safe.
Cool Thanks. We will also work on this.
You must be logged in to reply to this topic.