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.
Fork of FXLS8471Q by
Diff: FXLS8471Q.cpp
- Revision:
- 4:b6e0c4ad3aee
- Parent:
- 2:6aae25fe9ab4
--- a/FXLS8471Q.cpp Mon Jun 02 17:37:44 2014 +0000 +++ b/FXLS8471Q.cpp Thu Jan 18 07:53:41 2018 +0000 @@ -71,21 +71,43 @@ // [0]: active=0 databyte = 0x00; RegWrite(FXLS8471Q_CTRL_REG1, &databyte, 1); - - // write 0000 0001= 0x01 to XYZ_DATA_CFG register + + // write 0001 0010 = 0x12 to accelerometer control register 2 to place FXLS8471Q into + // [4:3]: smods=10 //high resolution + // [2]: auto-Sleep=0 // auto sleep off + // [1:0]: mods=10 //high resolution + + databyte=0x12; + RegWrite(FXLS8471Q_CTRL_REG2, &databyte, 1); + + //FXLS8471Q_CTRL_REG3 pines de interrupcion activos a nivel bajo y modo push-pull (no hace falta resistencia pull up) + + databyte=0x01; + RegWrite(FXLS8471Q_CTRL_REG4, &databyte, 1); //activar interrupcion data-redy + + databyte=0x01; + RegWrite(FXLS8471Q_CTRL_REG5, &databyte, 1); //routed to INT1 interrupcion data-redy + + databyte=0x01; + RegWrite(FXLS8471Q_CTRL_REG5, &databyte, 1); //routed to INT1 interrupcion data-redy + + // write 0001 0000= 0x01 to XYZ_DATA_CFG register /high pass filter enable // [7]: reserved // [6]: reserved // [5]: reserved - // [4]: hpf_out=0 + // [4]: hpf_out=1 // [3]: reserved // [2]: reserved // [1-0]: fs=00 for accelerometer range of +/-2g with 0.244mg/LSB - databyte = 0x00; + databyte = 0x10; RegWrite(FXLS8471Q_XYZ_DATA_CFG, &databyte, 1); + + atabyte = 0x03; // high pass filter 2 Hz + RegWrite(FXLS8471Q_HP_FILTER_CUTOFF, &databyte, 1); - // write 0001 0101b = 0x15 to accelerometer control register 1 + // write 0000 1101b = 0x15 to accelerometer control register 1 // [7-6]: aslp_rate=00 - // [5-3]: dr=010 for 200Hz data rate + // [5-3]: dr=001 for 200Hz data rate // [2]: lnoise=1 for low noise mode // [1]: f_read=0 for normal 16 bit reads // [0]: active=1 to take the part out of standby and enable sampling