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.
Dependencies: ADXL362 mbed MPL3115A2
Revision 19:51b2b42a82f1, committed 2018-02-23
- Comitter:
- htdoughe
- Date:
- Fri Feb 23 17:02:55 2018 +0000
- Parent:
- 18:216cc41b55f3
- Child:
- 20:8d93acd1f8cd
- Commit message:
- fixed issues with knocks
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 23 16:56:18 2018 +0000
+++ b/main.cpp Fri Feb 23 17:02:55 2018 +0000
@@ -146,7 +146,7 @@
y=adxl362.scany_u8();
z=adxl362.scanz_u8();
//if x, y, or z vary from baseline by at least 3, a knock has occured.
- if(x > initx+bs || y > inity+bs || z > initz+bs || x > initx-bs || y > inity-bs || z > initz-bs){
+ if(x > initx+bs || y > inity+bs || z > initz+bs || x < initx-bs || y < inity-bs || z < initz-bs){
led3 = 1;
count++;
printf("number of knocks: %d\r\n", count);