HW-6.1

Fork of MMA8451Q by Emilio Monti

Files at this revision

API Documentation at this revision

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, &regData, 1);
-    sprintf(lcdData, "%d", regData);
-    LCDMess(lcdData, BLINKTIME);
-    acc.readRegs(REG_WHO_AM_I, &regData, 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, &regData, 1);
+    sprintf(lcdData, "%d", regData);
+    LCDMess(lcdData, BLINKTIME);
+    acc.readRegs(REG_WHO_AM_I, &regData, 1);
+    springf(lcdData, "%d", regData);
+    LCDMess(lcdData, BLINKTIME);
+    
+    return regData;
+}
+