LMotor_Speed = Motor_Speed/100;
RMotor_Speed = Motor_Speed/100;}
if (Motor_Desig == 3){ /*STOP*/
LMotor_Speed = 1.5;
RMotor_Speed = 1.5;}
Motor();
}
}
}//End Costate
costate{
// This costate updates the GPS location and Heading in the Java application.
// printf("2");
//Flush serial port B & C input buffer
serBrdFlush();
serCrdFlush();
//Head Socket
tcp_listen(&Headsock,PORT1,0,0,NULL,0);
waitfor(sock_established(&Headsock));
sock_mode(&Headsock,TCP_MODE_ASCII);
//B Wait for the Heading message
while ((n = serBread(HeadIn, MAXSIZE-1, TIMEOUT)) == 0) ;
HeadIn[n] = 0;
//Copy Heading to buffer and send
sprintf(HeadOut, "%s",HeadIn);
sprintf(HeadBuffer, "\"%s\"\n\n",HeadOut);
sock_puts(&Headsock,HeadBuffer);
sock_close(&Headsock);
Comentarios a estos manuales