HW-6.1
Fork of MMA8451Q by
Revision 11:cf08b9a4f0dc, committed 2017-02-22
- Comitter:
- mireyarod23
- Date:
- Wed Feb 22 05:43:21 2017 +0000
- Parent:
- 10:5ad878e05e10
- Child:
- 12:e54564bbb2eb
- Commit message:
- s
Changed in this revision
MMA8451Q.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MMA8451Q.cpp Wed Feb 22 05:42:22 2017 +0000 +++ b/MMA8451Q.cpp Wed Feb 22 05:43:21 2017 +0000 @@ -53,17 +53,6 @@ writeRegs(data, 2); //make active } -uint8_t MMA8451Q::getGLimit(uint8_t regData) -{ - acc.getGLimit(); - acc.readRegs(XYZ_DATA_CFG, ®Data, 1); - sprintf(lcdData, "%d", regData); - LCDMess(lcdData, BLINKTIME); - acc.readRegs(REG_WHO_AM_I, ®Data, 1); - springf(lcdData, "%d", regData); - LCDMess(lcdData, BLINKTIME); -} - MMA8451Q::~MMA8451Q() { } uint8_t MMA8451Q::getWhoAmI() { @@ -111,3 +100,17 @@ void MMA8451Q::writeRegs(uint8_t * data, int len) { m_i2c.write(m_addr, (char *)data, len); } + +uint8_t MMA8451Q::getGLimit(uint8_t regData) +{ + acc.getGLimit(); + acc.readRegs(XYZ_DATA_CFG, ®Data, 1); + sprintf(lcdData, "%d", regData); + LCDMess(lcdData, BLINKTIME); + acc.readRegs(REG_WHO_AM_I, ®Data, 1); + springf(lcdData, "%d", regData); + LCDMess(lcdData, BLINKTIME); + + return regData; +} +