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
Diff: lcd_acc_46_v3.cpp
- Revision:
- 3:c575eee9fff2
- Parent:
- 2:8cdbe8a96b59
diff -r 8cdbe8a96b59 -r c575eee9fff2 lcd_acc_46_v3.cpp
--- a/lcd_acc_46_v3.cpp Mon Dec 01 00:29:40 2014 +0000
+++ b/lcd_acc_46_v3.cpp Mon Dec 01 15:55:53 2014 +0000
@@ -3,10 +3,7 @@
#include "SLCD.h"
/*
Test of the accelerometer, digital I/O, on-board LCD screen, and 16-bit ADC.
- Looing at vector product of the x-y components of the accelerometer.
- Works pretty well. Still rough, program wise - sc 140710
- Addiing touch sensor to replace potentiometer.
- Show x and y components
+
*/
#define BLINKTIME 0.7
@@ -77,15 +74,6 @@
}
-void runLEDs(int numberOfLEDS) {
- int i;
- for (i=0;i<numberOfLEDS; i++){
- LEDs[i] = LEDON;
- wait(0.2);
- }
- allLEDsOFF(numberOfLEDS);
-}
-
int main() {
@@ -102,7 +90,7 @@
float vMax = 0.0;
float DisplayTime = DATADISPDWELL;
int outState = false;
- char lcdData[10]; //buffer needs places dor decimal pt and colon
+ char lcdData[10]; //buffer needs places for decimal pt and colon
#ifdef PRINTDBUG
@@ -153,7 +141,6 @@
// --------------------------------------------
while (dataTimer.read() > DATATIME){
-//Get accelerometer data - tilt angles minus offset for zero mark.
// No offset
xAcc = abs(acc.getAccX());
yAcc = abs(acc.getAccY());
@@ -165,11 +152,7 @@
}
dataTimer.reset();
}
-#ifdef PRINTDBUG
- pc.printf("vector = %f\r\n", xAcc);
- pc.printf("scaling = %f\r\n", scaleExpansion);
- pc.printf("RawTemp = %f\r\n", FDeg);
-#endif
+
// Display the appropriate data on the LCD based upon what mode was chosen
while (displayTimer.read() > DisplayTime){
switch (displayState) {
