Выполняется корректное чтение данных иму. Оси и наклоны соответствуют рабочим прошивке и дрону
This commit is contained in:
@@ -5,18 +5,19 @@
|
||||
|
||||
#include "stm32g431xx.h"
|
||||
|
||||
#define ICM_ADDR 0x68
|
||||
#define ICM_ADDR 0x68
|
||||
#define REG_PWR_MGMT_1 0x06
|
||||
#define REG_BANK_SEL 0x7F
|
||||
#define REG_BANK_SEL 0x7F
|
||||
#define REG_GYRO_CONFIG_1 0x01
|
||||
#define REG_ACCEL_CONFIG 0x14
|
||||
#define IMU_DT 0.002f // 2 ms
|
||||
#define IMU_DT 0.002f // 2 ms
|
||||
|
||||
#define GYRO_FS_SEL_2000 3 << 1
|
||||
#define GYRO_DLPFCFG_73 3 << 3
|
||||
#define GYRO_FCHOICE_ON 1
|
||||
#define GYRO_FCHOICE_OFF 0
|
||||
|
||||
#define ACCEL_FS_SEL_4 1 << 1
|
||||
#define ACCEL_FS_SEL_8 2 << 1
|
||||
#define ACCEL_DLPFCFG_69 3 << 3
|
||||
#define ACCEL_FCHOICE_ON 1
|
||||
@@ -24,8 +25,8 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float ax, ay, az; // lsb
|
||||
float gx, gy, gz; // lsb
|
||||
int16_t ax, ay, az; // lsb
|
||||
int16_t gx, gy, gz; // lsb
|
||||
} imu_raw_t;
|
||||
|
||||
void imu_pow_init();
|
||||
|
||||
Reference in New Issue
Block a user