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:
fanbsun
Date:
Thu Feb 22 23:24:15 2018 +0000
Parent:
2:3299365b3e3c
Commit message:
update

Changed in this revision

vibration_explain.txt Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vibration_explain.txt	Thu Feb 22 23:24:15 2018 +0000
@@ -0,0 +1,8 @@
+For the vibration detector code fragment, basically, 
+
+1. we use an inner-while loop for continuously getting xyz data from accelerometer, 
+we store two values in 10ms delay inside two different variables x1, x2, and compare their differences. 
+2. If the difference is bigger than a certain threshold( in our test,
+ our x, y difference thresholds are 7 and z is 20), it will break out this inner loop, 
+ and go to outer loop which controls the led to turn on 2s. 
+3. After each time the led turns on, counter will add one and will print how many knocks we have.
\ No newline at end of file