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: FreescaleIAP MMA8451Q mbed
Revision 2:af202a1edd28, committed 2018-10-02
- 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