1.测试了QMI8658的驱动,正常读出x,y,z轴数据,得到的pitch, roll, yaw正常
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by misaki on 2025/8/23.
|
||||
//
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
|
||||
#include <I2C_Driver.h>
|
||||
#include <QMI8658.h>
|
||||
extern IMUdata Accel;
|
||||
extern IMUdata Gyro;
|
||||
void imu_test(void)
|
||||
{
|
||||
I2C_Init();
|
||||
QMI8658_Init();
|
||||
while (1) {
|
||||
QMI8658_Loop();
|
||||
ESP_LOGI("app_main", "Accel x: %f, y: %f, z: %f", Accel.x, Accel.y, Accel.z);
|
||||
ESP_LOGD("app_main", "Gyro X: %f, Y: %f, Z: %f", Gyro.x, Gyro.y, Gyro.z);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// Created by misaki on 2025/8/23.
|
||||
//
|
||||
|
||||
#ifndef BIONIC_SPHERE_DRIVERS_TEST_H
|
||||
#define BIONIC_SPHERE_DRIVERS_TEST_H
|
||||
|
||||
// imu测试
|
||||
void imu_test(void);
|
||||
|
||||
|
||||
#endif //BIONIC_SPHERE_DRIVERS_TEST_H
|
||||
Reference in New Issue
Block a user