![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fix libs
Dependencies: mbed FXOS8700 FXAS21002 MPL3115A2
Diff: main.cpp
- Revision:
- 2:eaf68a908096
- Parent:
- 1:835b21f32a6e
--- a/main.cpp Wed Apr 26 00:11:53 2017 +0000 +++ b/main.cpp Fri Dec 14 10:24:37 2018 +0000 @@ -38,7 +38,7 @@ // Initialize pins for I2C communication for sensors. Set jumpers J6,J7 in FRDM-STBC-AGM01 board accordingly. FXOS8700 accel(PTC2,PTC1); FXOS8700 mag(PTC2,PTC1); -FXAS21002 gyro(PTC2,PTC1); +FXAS21002 gyro(PTC2,PTC1,0x20); MPL3115 mpl3115(PTC2,PTC1); @@ -49,7 +49,7 @@ // Configure Accelerometer FXOS8700, Magnetometer FXOS8700 & Gyroscope FXAS21002 accel.accel_config(); mag.mag_config(); - gyro.gyro_config(); +// gyro.gyro_config(); mpl3115.MPL3115_config(); @@ -75,9 +75,9 @@ wait(0.005); - gyro.acquire_gyro_data_dps(gyro_data); - printf("%4.2f,%4.2f,%4.2f,",gyro_data[0],gyro_data[1],gyro_data[2]); - gyro_rms = sqrt(((gyro_data[0]*gyro_data[0])+(gyro_data[1]*gyro_data[1])+(gyro_data[2]*gyro_data[2]))/3); + // gyro.acquire_gyro_data_dps(gyro_data); + printf("%4.2f,%4.2f,%4.2f,",gyro.getX(),gyro.getY(),gyro.getZ()); + // gyro_rms = sqrt(((gyro.getX()*gyro.getX())+(gyro.getY()*gyro.getY())+(gyro.getZ()*gyro.getZ()))/3); wait(0.005); mpl3115.acquire_MPL3115_data_Altitude_in_m(alt_data);