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_minus_mod mbed
Fork of ACC_LCD_341_Basic by
Revision 7:ae5c27eb1492, committed 2016-11-21
- Comitter:
- dorian505
- Date:
- Mon Nov 21 01:09:16 2016 +0000
- Parent:
- 6:045defd0d877
- Child:
- 8:971f38affa78
- Commit message:
- v2
Changed in this revision
| acc_341.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/acc_341.cpp Sun Nov 20 21:15:54 2016 +0000
+++ b/acc_341.cpp Mon Nov 21 01:09:16 2016 +0000
@@ -16,7 +16,7 @@
#define xAxis 0
#define yAxis 1
#define zAxis 2
-
+#define DigitalIn button(LBUT)
#define PROGNAME "ACCLCD341-541\r\n"
#define PRINTDBUG
@@ -66,19 +66,18 @@
float zAcc;
xAcc = acc.getAccX();
yAcc = acc.getAccY();
- zAcc = acc.getAccZ();
- float DigitalIn = LBUT;
+ zAcc = acc.getAccZ();
initialize_global_vars();
// main loop forever
//Get accelerometer data - tilt angles minus offset for zero mark.
-
- for (int i=0; i < DigitalIn; i++){ // index will be 0 or 1
- if(!DigitalIn) { // a buttton is pressed
+ while (true) {
+ for (int i=0; i < digitalIn; i++){ // index will be 0 or 1
+ if(!digitalIn) { // a buttton is pressed
//xAcc = acc.getAccX();
//yAcc = acc.getAccY();
//zAcc = acc.getAccZ();
- int displayState = i;
+
switch (displayState){ // this keeps things generic
case xAxis:
LCDsignedFloat(xAcc);
