I’ve been working on a new Autonomous code for our robot, but I’ve run into a snag. The program won’t run all the way through. I’ve put print to screens in various positions to monitor the execution of the various stages, and of various variables, but I can’t find a good explanation. The robot will come to a specific leg of the program and won’t get out of/ in to the next loop. I’ve tried various loops, (starting with ‘leftquad > 54’, then ‘time > 500’) no mater how simple, the program will not progress. The bottom line/question. Have I reached the memory capacity of the VEXNet Microcontroller?
I haven’t read through your code in detail yet, but on quick inspection, I see that you’ve used assignment operators in a few if() and while() statements:
while ( counter1 = 1 )
...
if ( counter1 = 2 )
...
else if ( counter1 = 3 )
Did you mean these to be:
while ( counter1 == 1 )
...
if ( counter1 == 2 )
...
else if ( counter1 == 3 )
An old programmers trick is to always put the constant on the left of an equality comparison. That way you get a compilation error if you accidentally made it into an assignment:
while ( 1 == counter1 )
...
if ( 2 == counter1 )
...
else if ( 3 = counter1 ) // WON'T COMPILE
Thanks. I’m now here at WORLD’s, and am getting expert help. Well, not me, my robot! That was one of the things that the programming guys pointed out, though they couldn’t figure out what the loop problem was. I’m running tests and different variations now. They said that I definitely didn’t run out of memory on the Microcontroller.