I've tinkered and banged my head on the keyboard for a few days on this one. I know I'm close, but not quite there.

For the sentry III program:I can turn nice corners, stop when I come across a block. But there's one block that is close to a corner (only appears at end of the lap) that I just can't beat! It's driving me crazy. When I reach that corner, I can get the robot to stop mid turn and wait for the block. But it just doesn't move fast enough afterward. But I need accurate cornering because there is so little wiggle room on the board.

Here's my code for turning the corners. Suggestions?

Code:

void turnSwingRight90(){ wait1Msec(1000); int flag = 0; int degrees = 90; int initSensorReading = SensorValue(compass) % 360; // get the initial reading so we can compare to it and use it for calculations int turnPartial = (initSensorReading + 70) % 360; // get the number of degrees to turn to on the compass int turnTo = (initSensorReading + degrees) % 360; // get the number of degrees to turn to on the compass

// *** write a bit to make the compass value NOT = 360 ********************************

Oh my gosh! Just speeding the second half of the turn up to 20 did the trick and I didn't loose too much accuracy. (I know I tried that before - but I must have tried it in combination with something else at the time.)

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum