readlen++;
//Serial.print(*p,HEX);
break;
}
// Serial.print(*p,HEX);
p++;
readlen++;
}
}
// Serial.print("\n");
}
void
loop()
{
read_data();
if
(!protocol_prase(readbuff,readlen,&recv))
{
switch(recv.function)
{
case
E_BATTERY:
break
;
case
E_LED:
break;
case
E_INFO:
break;
case
E_ROBOT_CONTROL:
hbot.drive(protocol_prase_degree(&recv));
break;
case
E_ROBOT_CONTROL_SPEED:
hbot.setSpeed(protocol_prase_speed(&recv));
break
;
case
E_VERSION:
break;
}
}
}
105
Need help?
Do you have a question about the Hummer-Bot and is the answer not in the manual?