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
Fork of APP1_customProtocole by
Diff: acceleroMMA8452Q.cpp
- Revision:
- 7:7424c51ee942
- Parent:
- 6:5c8e02d5ebcc
--- a/acceleroMMA8452Q.cpp Mon Jan 11 20:01:34 2016 +0000 +++ b/acceleroMMA8452Q.cpp Tue Jan 12 20:28:24 2016 +0000 @@ -6,7 +6,7 @@ #include "acceleroMMA8452Q.h" #include "math.h" -#define CONVERT_FACTOR 5729.57795131 +#define CONVERT_FACTOR 5729.57795131 // 360/(2*PI) * 100 Accelero::Accelero(int frequency): i2cPort(p28, p27) { @@ -39,13 +39,13 @@ //Change the power mode command[0] = ACCELERO_REGISTER_CTRL_REG2; - command[1] = 0b11; + command[1] = 0b10; i2cPort.write(ACCELERO_WRITE_ADRESS, command, 2, false); //Put the accelerometer in active mode - //Change the data rate selection to 12.5Hz + //Change the data rate selection to 6.25Hz command[0] = ACCELERO_REGISTER_CTRL_REG1; - command[1] = (0b101 << 3) | 0b1; + command[1] = (0b110 << 3) | 0b1; i2cPort.write(ACCELERO_WRITE_ADRESS, command, 2, false); }