Build upon MMA7660_HelloWorld to pull out x, y, z axes from device and print to LCD on mbed Application Board

Dependencies:   C12832_lcd MMA7660 mbed

Fork of MMA7660_HelloWorld by Erik -

Here reside bits and pieces of coding that is mostly derivative of the work of others. Mostly extensions and other modifications.

The proprioception board project.

Board design images follow.

/media/uploads/chapfohn/260px-sphere-and-ring_balance_board_underside.jpg /media/uploads/chapfohn/obroc2.gif

/media/uploads/chapfohn/coolboard-balance-board-ultimate-package-medium-bot02-03-w450.png

Files at this revision

API Documentation at this revision

Comitter:
chapfohn
Date:
Mon May 06 02:10:12 2013 +0000
Parent:
1:0a7a84edc8e5
Child:
3:0d76aaff55b8
Commit message:
Axes labelled, separated into columns.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Apr 30 01:47:56 2013 +0000
+++ b/main.cpp	Mon May 06 02:10:12 2013 +0000
@@ -7,7 +7,7 @@
 C12832_LCD lcd;
 MMA7660 MMA(p28, p27);
 
-DigitalOut connectionLed(LED1);
+DigitalOut connectionLed(LED1);//for later debug
 
 int main() {  
     if (MMA.testConnection())
@@ -15,11 +15,17 @@
         
     while(1) {
         lcd.cls();//clear LCD for next reading round
-        lcd.locate(3,3);//initial LCD location
+        lcd.locate(3,3);//first LCD column label
+        lcd.printf("x-axis | ");//label column
+        lcd.locate(3,14);//xdata location
         lcd.printf("%.2f\n",MMA.x());//print x to LCD
-        lcd.locate(28,3);//move LCD location
+        lcd.locate(40,3);//second LCD column label
+        lcd.printf("y-axis | ");//label column
+        lcd.locate(40,14);//ydata location
         lcd.printf("%.2f\n",MMA.y());//print y to LCD
-        lcd.locate(53,3);//move LCD location
+        lcd.locate(77,3);//initial LCD location
+        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
     }