CPS-Lab* / Mbed 2 deprecated lab6

Dependencies:   ADXL362 mbed MPL3115A2

Revision:
10:8dcc46dd53bf
Parent:
9:a14593af628d
Child:
11:5aba4ea23082
Child:
12:c6b056ad171e
diff -r a14593af628d -r 8dcc46dd53bf main.cpp
--- a/main.cpp	Thu Feb 22 21:11:24 2018 +0000
+++ b/main.cpp	Thu Feb 22 21:13:54 2018 +0000
@@ -133,16 +133,21 @@
     adxl362.reset();
     wait_ms(600); // we need to wait at least 500ms after ADXL362 reset
     adxl362.set_mode(ADXL362::MEASUREMENT);
-    int8_t x,y,z; 
+    int8_t x,y,z, initx, inity, intiz; 
     int start, length;
     start = 0;
     length = 5;
     adxl362_reg_print(start, length);
+    
+    //initial values of x, y, and z.
+    //These values are the baseline for the accelerometer; knocks are detected
+    // in relation to these initial values
     initx=adxl362.scanx_u8();
     inity=adxl362.scany_u8();
     initz=adxl362.scanz_u8();
     
     while(1) {
+        //get the values of x, y, and z to test for a knock
         x=adxl362.scanx_u8();
         y=adxl362.scany_u8();
         z=adxl362.scanz_u8();