(Work in progress)
- IMU evaluation board that is small enough as a wearble device
- IMU data visualization by an Android GUI app
- Human motion recognition by TensorFlow with the IMU board
[InvenSense MPU-9255 (HiLetgo MPU9250 module)]--I2C--[PIC16F1825]--USB serial--[Android app]
- 80Hz for accelerometer and gyroscope (40Hz LPF is applied to the data on the chip)
- 5Hz for magnetometer
The module I purchased from Amazon is MPU-9255. The module includes an accelerometer, a gyroscope and a mangetometer from Asahi Kasei.
The universal board has 14 holes x 17 holes.
I use I2C bus to access all the sensors in the module.
=> Case
Although i2c_master_example.h and i2c_master_example.c generated by MCC is just an example implementation, the APIs in the implementation are very easy to understand and work very well for basic I2C operations.
#include <stdint.h>
#include <stdio.h>
#include "../i2c_master.h"
uint8_t I2C_Read1ByteRegister(i2c_address_t address, uint8_t reg);
uint16_t I2C_Read2ByteRegister(i2c_address_t address, uint8_t reg);
void I2C_Write1ByteRegister(i2c_address_t address, uint8_t reg, uint8_t data);
void I2C_Write2ByteRegister(i2c_address_t address, uint8_t reg, uint16_t data);
void I2C_WriteNBytes(i2c_address_t address, uint8_t *data, size_t len);
void I2C_ReadNBytes(i2c_address_t address, uint8_t *data, size_t len);
void I2C_ReadDataBlock(i2c_address_t address, uint8_t reg, uint8_t *data, size_t len);