Lorawan to Pulga

Dependencies:   pulga-lorawan-drv SPI_MX25R Si1133 BME280

BMX160.txt

Committer:
brunnobbco
Date:
3 months ago
Revision:
61:65744bc8ab55

File content as of revision 61:65744bc8ab55:

#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};