使用命令行参数

This commit is contained in:
xinyang
2019-04-14 19:32:29 +08:00
parent 63e45eb43e
commit 1070c5caa7
2 changed files with 11 additions and 10 deletions

View File

@@ -103,8 +103,9 @@ void uartReceive(Uart* uart){
}else if(cnt==1 && buffer[0]=='a'){
state = ARMOR_STATE;
LOGM("State switch to armor!");
}else{
sscanf(buffer, "%f %f", &yaw, &pitch);
}else if(cnt==8){
memcpy(&yaw, buffer, 4);
memcpy(&pitch, buffer+4, 4);
LOGM("Get yaw:%f pitch:%f", yaw, pitch);
}
cnt = 0;