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:41:29 2017 +0000
Parent:
8:c6f68b403325
Child:
10:5ad878e05e10
Commit message:
adding;

Changed in this revision

MMA8451Q.cpp Show annotated file Show diff for this revision Revisions of this file
MMA8451Q.h Show annotated file Show diff for this revision Revisions of this file
--- a/MMA8451Q.cpp	Wed Feb 22 05:22:33 2017 +0000
+++ b/MMA8451Q.cpp	Wed Feb 22 05:41:29 2017 +0000
@@ -53,6 +53,17 @@
     writeRegs(data, 2); //make active
 }
 
+uint8_t MMA8451Q::getGLimit() 
+{
+    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() {
--- a/MMA8451Q.h	Wed Feb 22 05:22:33 2017 +0000
+++ b/MMA8451Q.h	Wed Feb 22 05:41:29 2017 +0000
@@ -102,10 +102,12 @@
   
   void setGLImit();
   
+
 private:
   I2C m_i2c;
   int m_addr;
   void readRegs(int addr, uint8_t * data, int len);
+    
   void writeRegs(uint8_t * data, int len);
 
 };