DHeadLoc5 = strtok(NULL, p);
WPLONGDEG = atof(DHeadLoc5);
printf("WPLong Degrees = %f\n", WPLONGDEG);
DHeadLoc6 = strtok(NULL, p);
WPLONGMIN = atof(DHeadLoc6);
printf("WPLong Minutes = %f\n", WPLONGMIN);
DHeadLoc7 = strtok(NULL, p);
DIST = 25;
//Main Navigation Loop
while(DIST>20){
// printf("3");
/*Initial read.*/
navread();
yield;
/*Check for major course correction and turn.*/
while (ABSDIFF >= 15 && (360-ABSDIFF) >= 15 && DIST >20){
navread();
if (ABSDIFF <= 180) {
if (DIFF <= 0){printf("1"); /*Right turn*/
LMotor_Speed = 2;
RMotor_Speed = 1;}
else{/*Left turn*/
LMotor_Speed = 1;
RMotor_Speed = 2;}
}
else{
if (DIFF > 0) { /*Right turn*/
DIFF= 360-ABSDIFF;
LMotor_Speed = 2;
RMotor_Speed = 1;}
else{/*Left turn*/
Comentarios a estos manuales