Problems with Programming

Hi again. :slight_smile:

Yesterday, I tried to program some autonomous codes into the robot, but it didn’t exactly work out the way it was supposed to. Half the time, there was a red light on next to the “code error” message on the O/I and the robot wouldn’t do anything at all, and when I input the code for a simple autonomous program to make the robot drive forward, stop, turn left, stop, then drive forward again and stop, it only went forward and didn’t stop at all.

Another problem that I’ve been having is when I program for RC control with the joysticks (using the Arcade 4 programming for 4 wheel drive), the joysticks won’t work. One set of wheels will constantly spin when the other set doesn’t, and if I can finally get both sides to stop completely (which takes some tedious calibrations of both joysticks) I can’t get them to move again. Speaking of both joysticks, we’ve also been having some issues with getting our robot to work on only one joystick. Last time we had only one joystick, one wheel would constantly spin and wouldn’t respond to the joystick movements. I was wondering if that was an error with the default programming since nothing else had been programmed into the Controller when we were having that problem.

Would anyone be able to tell me what’s going on with the robot? Is there something that I’m not programming correctly?

This is somethign that I always say to our programmer because i know nothing about programming but somehow this is always what happens:

“Did you reset the variable?”

Please post your autonomous code so we can determine if something is wrong over there.

Just some simple programming from one of the tutorials. This is the one that makes the robot continously move in one direction without stopping.
http://img303.imageshack.us/img303/8523/prog4ju.jpg

And this is the code that makes the “Code Error” light turn red on the O/I.
http://img155.imageshack.us/img155/3729/prog24qk.jpg

OK. If you want to robot to stop immediately after moving forward the best choice is to “reverse brake” or set the values to the opposite for a moment if you drivetrain can handle it. Also make sure you debug everything, sometimes somewhere in your code you set a very broad if statement or else so that a pwm is 127 and this affects the rest of your code, especially if it occurs under your desired section. Your best bet is to create a flow chart, that always helps with me when I’m in this situation.\

And about that code light, I hate it and I don’t know whats up so I compile the code a lot and add it to the controller just to check for the code error and if it works so I know where I screwed up on the code. Good luck.