Update of punch program using the accelerometer on the KL46Z

Dependencies:   MMA8451Q8a SLCD mbed

Fork of LCD_punch_mtr_8_v5_class by Stanley Cohen

Files at this revision

API Documentation at this revision

Comitter:
scohennm
Date:
Sat Jan 10 16:48:10 2015 +0000
Parent:
4:89ae38dc05a9
Child:
6:c2f31918cf77
Commit message:
Added more comments and reference to data sheet.

Changed in this revision

LCD_punch_mtr8_v5.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/LCD_punch_mtr8_v5.cpp	Thu Dec 11 00:40:20 2014 +0000
+++ b/LCD_punch_mtr8_v5.cpp	Sat Jan 10 16:48:10 2015 +0000
@@ -43,6 +43,7 @@
 #define PROGNAME "LCD_punch_mtr 8 v5\r/n"
 #define LCDNAME "PC.V5"
 
+
 //#define PRINTDBUG
 // Accelerometer SPI pins
 #if   defined (TARGET_KL25Z) || defined (TARGET_KL46Z)
@@ -133,7 +134,10 @@
     dataTimer.start();
     dataTimer.reset();
     LCDMess(RSTARTMESS, BLINKTIME);
- // Set 8 g max limit
+// Go into registers ofn Accelerometer, change sensitivity then test.
+// http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8451Q.pdf
+// See page 26
+// Set 8 g max limit
     acc.setGLimit(MAX_8G); // For now set to 8g
     acc.readRegs(XYZ_DATA_CFG, &regData, 1);
     sprintf (lcdData,"%d",regData);