LELEC2811 - I&S / Mbed 2 deprecated LELEC_2811_Accelerometer_2

Dependencies:   FreescaleIAP MMA8451Q mbed

Files at this revision

API Documentation at this revision

Comitter:
martlefebvre94
Date:
Tue Oct 02 07:30:21 2018 +0000
Parent:
1:19cb7d77efe1
Commit message:
FSR fixed with #define

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun Sep 23 09:57:41 2018 +0000
+++ b/main.cpp	Tue Oct 02 07:30:21 2018 +0000
@@ -6,6 +6,7 @@
 #include "MMA8451Q.h"       // Accelerometer
 
 #define MMA8451_I2C_ADDRESS (0x1d<<1)
+#define FSR                     0x02    // 0x00 for 2G, 0x01 for 4G, 0x02 for 8G
 
 #define NO_JUMPER               0
 #define JUMPER_PRESENT          1
@@ -41,7 +42,7 @@
 
 // --- Setup I2C for MMA8451
 // --- The last argument is the full scale range (FSR). 0x00 for 2G, 0x01 for 4G, 0x02 for 8G
-MMA8451Q my8451(PTE25, PTE24, MMA8451_I2C_ADDRESS, 0x02);
+MMA8451Q my8451(PTE25, PTE24, MMA8451_I2C_ADDRESS, FSR);
 
 // --- Set Serial Port
 Serial Host_Comm(USBTX, USBRX); // tx, rxSerial pc(USBTX, USBRX); // tx, rx