Initial commit

This commit is contained in:
2026-02-20 20:39:17 +01:00
commit e8b56b4142
12 changed files with 591 additions and 0 deletions

25
mpu_handler.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef MPU_HANDLER_H
#define MPU_HANDLER_H
#include "pico/stdlib.h"
#include "hardware/i2c.h"
#define I2C_PORT i2c0
#define SDA_PIN 4
#define SCL_PIN 5
#define MPU_ADDR 0x68
#define MAG_ADDR 0x0C
typedef struct {
float ax, ay, az;
float gx, gy, gz;
float mx, my, mz;
} MPU_Data_t;
void mpu_init(void);
void mpu_calibrate(void);
void mpu_read_data(MPU_Data_t *data);
#endif //MPU_HANDLER_H