资 源 简 介
//使用NXP的LPC1114FN33的P0_11,P1_10连接MPU6050的IIC,采用MPU6050的DMP方式,直接获取四元数计算姿态,数据很稳定,还可以初始化零位,最大计算频率200Hz,一般的应用足够
int main (void)
{
int16_t temp[9];
// float ypr[3];
float temp1;
float temp2;
int16_t angle_temp1,angle_temp2,angle_temp3,angle_circle;
// uint8_t i,ucErr,sign = 0;
// uint8_t flash_temp[256],flash_temp2[256],i;
int16_t Math_hz=0;//,last_Math_hz = 0;
int16_t yaw,pitch,roll,full_yaw;
int16_t last_yaw=0;
SystemInit();
/* Enable AHB clock to the GPIO domain. */
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6)|(1<<9);
LPC_GPIO1->DIR |= (1<<6);
I2CSlaveInit();
IIC_Init();
delay_ms(100);
LED_ON;
if(!mpu_init())
{
//PrintChar("mpu initialization complete......
"); //mpu_set_sensor
if(!mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL))
LED_ON;//PrintChar("mpu_set_sensor complete ......
");
else
LED_OFF;//PrintChar(