Manual
19 | P a g e
}
void loop(){
AttachCmd();
if(MotorGap.check()){
if(left != 0 || right != 0)
Motor_Control(rr,map(constrain(abs(right),10,45), 10,
45,150,255),lr,map(constrain(abs(left),10,45), 10, 45,150,255));
else Motor_Control(0,0,0,0);
}
}
int BluetoothCmd[15];
int BlankPos[5];
int BlankCount = 0;
int Endbyte = 0x0A;
void AttachCmd(){
if(Serial.available()){
unsigned long timer = millis();
int i = 0;
int RetryCounter = 0;
int num = 0;
boolean valid = true;
for(int j = 0; j<10; j++)
BluetoothCmd[j] = 0;
byte firstByte = Serial.read();
//Serial.println(input,BYTE);
if(firstByte >= 'a' && firstByte <= 'z')
{
//Serial.println("PassHeader");
switch(firstByte){
case 'w':
BlankCount = 0;
for(i = 0;i < 5; i++) BlankPos[i] = 0;
break;