eCompass (6-axes electronic compass) / Electronic Compass with Three-axis Magnetic Field Sensor and Three-axis Accelerometer by Bosch Sensortech
Dependents: BLE_EddystoneBeacon_w_ACC_TY51822
Diff: BMC050.h
- Revision:
- 2:93141eb80862
- Parent:
- 1:b022f8d7884d
- Child:
- 3:24aa4d5fa7de
--- a/BMC050.h Sun Sep 07 07:15:37 2014 +0000 +++ b/BMC050.h Wed Jun 01 12:30:38 2016 +0000 @@ -3,11 +3,11 @@ * BMC050 COMPASS 6 AXIS, made by Bosch Sensortec * http://jp.bosch-sensortec.com/content/language1/html/5033.htm * - * Copyright (c) 2014 Kenji Arai / JH1PJL + * Copyright (c) 2014, 2016 Kenji Arai / JH1PJL * http://www.page.sannet.ne.jp/kenjia/index.html * http://mbed.org/users/kenjiArai/ * Created: July 19th, 2014 - * Revised: September 7th, 2014 + * Revised: June 1st, 2016 * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE @@ -120,6 +120,7 @@ #define BMC050_DR_30 7 // definition for Nomalization +//Gravity at Earth's surface in m/s/s #define GRAVITY (9.80665F) #define BMC050_GAIN (3.91F) #define BMC050_DUMMY 0 @@ -169,10 +170,10 @@ * float fa[3]; * float fg[3]; * - * if (bmc050.read_id_acc() == BMC050_A_G_CHIP_ADDR){ + * if (bmc050.read_id_acc() == I_AM_BMC050_ACC){ * bmc050.read_data_acc(fa); * } - * if (bmc050.read_id_mag() == BMC050_M_GG_CHIP_ADDR){ + * if (bmc050.read_id_mag() == I_AM_BMC050_MAG){ * bmc050.read_data_mag(fg); * } * } @@ -286,8 +287,8 @@ I2C i2c; private: - float fs_factor_acc;// full scale factor - char dbf[2]; // working buffer + float fs_factor_acc; // full scale factor + char dbf[2]; // working buffer uint8_t acc_addr; // acc sensor address uint8_t acc_id; // acc ID uint8_t acc_ready; // acc is on I2C line = 1, not = 0