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: C12832_lcd MMA7660 mbed
Fork of MMA7660_HelloWorld by
Revision 4:10426f54d388, committed 2013-06-04
- Comitter:
- chapfohn
- Date:
- Tue Jun 04 04:16:34 2013 +0000
- Parent:
- 3:0d76aaff55b8
- Child:
- 5:ba17585f3a2a
- Commit message:
- Program reads x, y axis data into array, totals and averages.
; Removed Debug wait artefacts.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 04 04:10:17 2013 +0000
+++ b/main.cpp Tue Jun 04 04:16:34 2013 +0000
@@ -26,14 +26,12 @@
for (i = 0; i < n; i = i + 1) { //read n values into each axis array
pulseX[i] = MMA.x();
pulseY[i] = MMA.y();
- //wait (1);
}
pulseXT = 0; //reset Totala
pulseYT = 0; //reset Totala
for (j = 0; j < n; j = j + 1) { //summation of the contents of each array into axis Totals
pulseXT = pulseXT+pulseX[j];
pulseYT = pulseYT+pulseY[j];
- //wait (1);
}
pulseXa = pulseXT/n; //axis average over n
@@ -56,6 +54,5 @@
lcd.printf("z-axis");//label column
lcd.locate(77,14);//zdata location
lcd.printf("%.2f\n",MMA.z());//print z to LCD
- //wait(0.5);//update after 0.5 s
}
}
\ No newline at end of file
