Test program for mbed app shield potentiometers

Dependencies:   C12832

Fork of apps-shield-pots by Chris Styles

Revision:
1:e50da1f1f653
Parent:
0:cca95aa94e09
Child:
2:989f84939300
--- a/main.cpp	Wed Jan 08 01:19:09 2014 +0000
+++ b/main.cpp	Wed Jan 08 16:58:55 2014 +0000
@@ -1,6 +1,9 @@
 #include "mbed.h"
 #include "C12832_lcd.h"
 
+#include "LM75B.h"
+#include "MMA7660.h"
+
 // Map the LPC1768 pins to the arduino pin names
 // These are the only things that are constant between ARCH, FRDM, u-blox etc
 #define ARD_D5  P2_1
@@ -9,9 +12,14 @@
 #define ARD_D11 P1_24
 #define ARD_D12 P1_23
 #define ARD_D13 P1_20
+#define ARD_SDA P0_0
+#define ARD_SCL P0_1
 
 DigitalOut redled(ARD_D5);
 
+LM75B sensor(ARD_SDA,ARD_SCL);
+MMA7660 MMA(ARD_SDA,ARD_SCL);
+
 // ==== Using SDK primitives ======
 // Construct the required pin functions, this works!
 
@@ -37,14 +45,39 @@
 {
 
     int i=0;
+    
+    
+    
+        while(1) {
+            lcd.cls();
+            lcd.locate(0,3);
+            lcd.printf("Temp = %.3f", (float)sensor);
+            lcd.locate(0,14);
+            lcd.printf("x=%.2f y=%.2f z=%.2f",MMA.x(), MMA.y(), MMA.z());
+            redled = !redled;
+            wait(1.0);
+            i++;
+
+        }    
+    
+    
+    
+    
+    
+    
+    /*
+    
+    
+    
+    
     while(1) {
 
 // === USING THE LCD ====
 // Note that the program will hang, even if we do not call any of the LCD functions
 // Is it the cosntructor breaking things
-//        lcd.cls();
-//        lcd.locate(0,3);
-//        lcd.printf("Hello %d",i);
+        lcd.cls();
+        lcd.locate(0,3);
+        lcd.printf("Hello %d",i);
                 
                 
 // === USING THE SDK Primitives ===
@@ -60,5 +93,9 @@
         redled = !redled; // I have an red LED on my test board.. for sanity :)
         i++;
     }
+*/
+
+
+
 
 }