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: mbed FXOS8700 FXAS21002 MPL3115A2
Diff: main.cpp
- Revision:
- 2:eaf68a908096
- Parent:
- 1:835b21f32a6e
- Child:
- 3:04bf20362085
--- 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);