将ICM42688改为硬件SPI通讯。
This commit is contained in:
23
APP/mymain.c
23
APP/mymain.c
@ -6,6 +6,7 @@
|
||||
|
||||
void mymain()
|
||||
{
|
||||
HAL_UART_Receive_IT(&huart1, (uint8_t *)g_rx_buffer, RXBUFFERSIZE); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
|
||||
HAL_Delay(2000);
|
||||
led_init();
|
||||
tle5012b_init();
|
||||
@ -17,13 +18,13 @@ void mymain()
|
||||
float x = 0,y=0;
|
||||
unsigned int i =0;
|
||||
HAL_TIM_Base_Start(&htim5); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
while(i<3300*3)
|
||||
{
|
||||
Angel_closed_loop(motorx,&FOCStruct_X,-0.2);
|
||||
Angel_closed_loop(motory,&FOCStruct_Y,2.3);
|
||||
i++;
|
||||
}
|
||||
i=0;
|
||||
// while(i<3300*3)
|
||||
// {
|
||||
// Angel_closed_loop(motorx,&FOCStruct_X,-0.2);
|
||||
// Angel_closed_loop(motory,&FOCStruct_Y,2.3);
|
||||
// i++;
|
||||
// }
|
||||
// i=0;
|
||||
LED_ON;
|
||||
while(1)
|
||||
{
|
||||
@ -33,6 +34,7 @@ void mymain()
|
||||
y = Angle.roll ;
|
||||
Zitai_closed_loop(motorx,&FOCStruct_X,x);
|
||||
Zitai_closed_loop(motory,&FOCStruct_Y,-y);
|
||||
commander_run();
|
||||
// x = getAngle(motorx);
|
||||
// y = getAngle(motory);
|
||||
// printf("%fY%f\n",x,y);
|
||||
@ -45,7 +47,10 @@ void mymain()
|
||||
// }
|
||||
// i++;
|
||||
//
|
||||
Data_send(x,y);
|
||||
// Data_send(x,y);
|
||||
// HAL_Delay(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user