MPU6050串口发送姿态数据由%.3f改为%f,gambal修改接收数据的个位数,和修改PID值
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
//#include "math.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
u8 USART_RX_BUF[20];
|
||||
u8 USART_RX_BUF[30];
|
||||
//<2F><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||
unsigned short USART_RX_STA=0; //<2F><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>־
|
||||
|
||||
@ -41,8 +41,8 @@ unsigned short USART_RX_STA=0; //
|
||||
|
||||
u32 RX_CNT = 0;
|
||||
u8 f;
|
||||
u8 x[10];
|
||||
u8 y[10];
|
||||
u8 x[12];
|
||||
u8 y[12];
|
||||
void USART1_IRQHandler(void)
|
||||
{
|
||||
unsigned char res;
|
||||
@ -61,8 +61,8 @@ void USART1_IRQHandler(void)
|
||||
else
|
||||
{
|
||||
memcpy(x,USART_RX_BUF,f+1);
|
||||
memcpy(y,USART_RX_BUF+f+1,20-f-1);
|
||||
memset(USART_RX_BUF,0,20);
|
||||
memcpy(y,USART_RX_BUF+f+1,30-f-1);
|
||||
memset(USART_RX_BUF,0,30);
|
||||
RX_CNT = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user