CPS-Lab* / Mbed 2 deprecated Lab6

Dependencies:   ADXL362 mbed

vibration_explain.txt

Committer:
fanbsun
Date:
2018-02-22
Revision:
3:02e11688fd56

File content as of revision 3:02e11688fd56:

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.