Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
vibration_explain.txt@3:02e11688fd56, 2018-02-22 (annotated)
- Committer:
- fanbsun
- Date:
- Thu Feb 22 23:24:15 2018 +0000
- Revision:
- 3:02e11688fd56
update
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| fanbsun | 3:02e11688fd56 | 1 | For the vibration detector code fragment, basically, |
| fanbsun | 3:02e11688fd56 | 2 | |
| fanbsun | 3:02e11688fd56 | 3 | 1. we use an inner-while loop for continuously getting xyz data from accelerometer, |
| fanbsun | 3:02e11688fd56 | 4 | we store two values in 10ms delay inside two different variables x1, x2, and compare their differences. |
| fanbsun | 3:02e11688fd56 | 5 | 2. If the difference is bigger than a certain threshold( in our test, |
| fanbsun | 3:02e11688fd56 | 6 | our x, y difference thresholds are 7 and z is 20), it will break out this inner loop, |
| fanbsun | 3:02e11688fd56 | 7 | and go to outer loop which controls the led to turn on 2s. |
| fanbsun | 3:02e11688fd56 | 8 | 3. After each time the led turns on, counter will add one and will print how many knocks we have. |