Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: pulga-lorawan-drv SPI_MX25R Si1133 BME280
BMX160.txt
- Committer:
- ruschigo
- Date:
- 2021-03-02
- Revision:
- 64:ed68ddac6360
- Parent:
- 61:65744bc8ab55
File content as of revision 64:ed68ddac6360:
#include "mbed.h"
/* defines the axis for acc */
#define ACC_NOOF_AXIS 3
#define GYR_NOOF_AXIS 2
/* bmi160 slave address */
#define BMI160_ADDR ((0x69)<<1)
#define RAD_DEG 57.29577951
I2C i2c(p13, p15);
/* buffer to store acc samples */
int16_t acc_sample_buffer[ACC_NOOF_AXIS] = {0x5555, 0x5555, 0x5555};
int16_t gyr_sample_buffer[GYR_NOOF_AXIS] = {0x5555, 0x5555};
double acc_result_buffer[ACC_NOOF_AXIS] = {0x5555, 0x5555, 0x5555};
double gyr_result_buffer[GYR_NOOF_AXIS] = {0x5555, 0x5555};
double accel_ang_x, accel_ang_y;
double tiltx, tilty;
double tiltx_prev, tilty_prev;
char i2c_reg_buffer[2] = {0};