Help! with compass
Nissa
Posts: 2
hello, i have recently been working on creating a program that will start in one spot and use the compass to roam and avoid objects until it ends up back in the begining location. I wrote the code and thought it was ok but when i try and run it the bot doesn't do anything and i can't seem to see the problem.
Comments
Consider writing the program in smaller chunks.· For example, start with a program that displays the direction in the Debug Terminal.· When you know that works, comment out the debug code and then modifiy the program so that the Boe-Bot goes forward when it detects that it's pointing north.· Keep building it in small increments, and save under new file names frequently so that you can backtrack to older revisions.
·
i'll try that and see how it turns out...
You can cause your current heading to be different from the old heading before the DO UNTIL...LOOP by adding a SERIN command to get an initial heading value before the DO...LOOP starts. You may also need to set oldHeading to a value if you expect the SERIN command to load a zero into the heading variable.