lab 6

Dependencies:   ADXL362 mbed MPL3115A2

Committer:
htdoughe
Date:
Thu Feb 22 21:29:19 2018 +0000
Revision:
12:c6b056ad171e
Child:
29:f328fa35e8eb
documentation written for virbration detection

Who changed what in which revision?

UserRevisionLine numberNew contents of line
htdoughe 12:c6b056ad171e 1 # Documentation for Vibration Detection
htdoughe 12:c6b056ad171e 2
htdoughe 12:c6b056ad171e 3 Our algorithm is fairly simple right now; it measures knocks by comparing x, y, and z
htdoughe 12:c6b056ad171e 4 values to an initial baseline set of values. When the program starts, it saves
htdoughe 12:c6b056ad171e 5 initx, inity, and initz (uint8_t values); these are the initial baseline values for
htdoughe 12:c6b056ad171e 6 each axis of measurement for the accelerometer. The program then enters a
htdoughe 12:c6b056ad171e 7 perpetual while loop that measures x, y, and z and compares those new measurements
htdoughe 12:c6b056ad171e 8 to their respective initial values. If any of these measured values vary from their
htdoughe 12:c6b056ad171e 9 initial values by more than 2 (in either a positive or negative direction), the
htdoughe 12:c6b056ad171e 10 LED lights for 2 seconds and measurement pauses. After those 2 seconds, measurement
htdoughe 12:c6b056ad171e 11 resumes.
htdoughe 12:c6b056ad171e 12
htdoughe 12:c6b056ad171e 13 This algorithm assumes 2 main things about the evironment: that any knock is
htdoughe 12:c6b056ad171e 14 significant enough to change the measured value from the initial value by at least 3,
htdoughe 12:c6b056ad171e 15 and that the baseline does not change (that is, that the board's orientation is fixed
htdoughe 12:c6b056ad171e 16 during program execution).