Accelerations in 3D with Analog Devices ADXL362. The PmodACL2 was used but should work with almost any sensor module with the ADXL362. The ADXL362 connects with SPI. The library ADXL362 published by Analog Devises includes the necessary methods for setting up the sensor and reading the acceleration results.

Dependencies:   ADXL362

Files at this revision

API Documentation at this revision

Comitter:
jackclar
Date:
Fri Feb 23 16:48:58 2018 +0000
Parent:
2:3299365b3e3c
Child:
5:4d6ef028eeae
Commit message:
v3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Feb 22 23:17:52 2018 +0000
+++ b/main.cpp	Fri Feb 23 16:48:58 2018 +0000
@@ -17,8 +17,8 @@
     ADXL362.reset();
     wait_ms(600); // we need to wait at least 500ms after ADXL362 reset
     ADXL362.set_mode(ADXL362::MEASUREMENT);
-    ADXL362_knock_detect();
-    //ADXL362_reg_print(0, 0);
+    //ADXL362_knock_detect();
+    ADXL362_reg_print(0, 0);
 }
 
 void ADXL362_knock_detect()
@@ -64,7 +64,7 @@
     uint8_t i;
     std::string name;
     ADXL362::ADXL362_register_t reg;
-    if(start >= 0x00 && start <= 0x2E && length >= 0x00 && (ADXL362.read_reg(ADXL362.DEVID_AD) == 0xAC))
+    if(start >= 0x00 && start <= 0x2E && length >= 0x00 && (ADXL362.read_reg(ADXL362.DEVID_AD) == 0xAD))
     {
         if(length == 0)
         {