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: MMA8451Q SLCD mbed
Fork of LCD_ACC_46_v4-2g by
Revision 5:e85646fe737e, committed 2017-02-20
- Comitter:
- mturner5
- Date:
- Mon Feb 20 06:36:42 2017 +0000
- Parent:
- 4:41920817d234
- Child:
- 6:16b55f8cde97
- Commit message:
- revision;
Changed in this revision
| lcd_acc_46_v-2g.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/lcd_acc_46_v-2g.cpp Fri Feb 10 19:28:50 2017 +0000
+++ b/lcd_acc_46_v-2g.cpp Mon Feb 20 06:36:42 2017 +0000
@@ -140,16 +140,23 @@
}
// --------------------------------------------
- while (dataTimer.read() > DATATIME){
+ while (dataTimer.read() > DATATIME){ //correct place?
// No offset
xAcc = abs(acc.getAccX());
+ xcounts = acc.getAccAxis(REG_OUT_X_MSB);
yAcc = abs(acc.getAccY());
zAcc = abs(acc.getAccZ());
// Calulate vector sum of x,y and z reading.
-// vector = sqrt(pow(xAcc,2) + pow(zAcc,2));
+ vector = sqrt(pow(xAcc,2) + pow(zAcc,2));
vector = zAcc;
if (vector > vMax) {
+ accaxisdata[XCOMPD] = (float)xCounts; //why xCounts?
+ accaxisdata[YCOMPD] = yAcc;
+ accaxisdata[zCOMPD] = zAcc;
+ accaxisdata[VMAXD] = vMax;
vMax = vector;
+ dataTimer.reset();
+ LEDDwell = 1.1 - vMax/MAXGS //don't unbderstand where this comes from
}
dataTimer.reset();
}
