Example using sensors from the mbed apps board or shield

Dependencies:   C027 LM75B MMA7660 mbed

Files at this revision

API Documentation at this revision

Comitter:
sam_grove
Date:
Mon Feb 03 13:39:47 2014 +0000
Parent:
2:c9e55bcfce9c
Child:
4:3cdb403b30e2
Commit message:
Updated for C027

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/C12832_lcd.lib	Mon Feb 03 05:10:09 2014 +0000
+++ b/C12832_lcd.lib	Mon Feb 03 13:39:47 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/chris/code/C12832_lcd_fork/#8a9cad03124b
+http://mbed.org/users/sam_grove/code/C12832_lcd/#3420eaf252ad
--- a/main.cpp	Mon Feb 03 05:10:09 2014 +0000
+++ b/main.cpp	Mon Feb 03 13:39:47 2014 +0000
@@ -1,32 +1,36 @@
 #include "mbed.h"
 #include "C027.h"
 #include "C12832_lcd.h"
+#include "LM75B.h"
 #include "MMA7660.h"
-#include "LM75B.h"
 
 #define MBED_APPS_SHIELD
 //#define MBED_APPS_BOARD
 
-DigitalOut myled(LED1);
-
 #if defined(MBED_APPS_SHIELD)
+  C12832_LCD lcd(D11, D13, D12, D7, D10);
+  DigitalOut myled(P3_25);
+  LM75B temperature_sensor(SDA, SCL);
   MMA7660 mma(SDA, SCL);
-  LM75B temperature_sensor(SDA, SCL);
 #elif defined(MBED_APPS_BOARD)
-  MMA7660 mma(p28, p27);
-  LM75B temperature_sensor(p28, p27);
+  C12832_LCD lcd(p5, p7, p6, p8, p11);
+  DigitalOut myled(LED1);
 #else
 #error application board not defined
 #endif
 
-int main()
-{
+int main() {
+    lcd.cls();
+    lcd.locate(0,3);
+    lcd.printf("Sensor Lab\n");
     while(1) {
-        
-        float temp = temperature_sensor;
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+        float temperature = temperature_sensor;
         float x = mma.x();
         float y = mma.y();
         float z = mma.z();
-        wait(1.0f);
     }
 }
--- a/mbed.bld	Mon Feb 03 05:10:09 2014 +0000
+++ b/mbed.bld	Mon Feb 03 13:39:47 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/dc225afb6914
\ No newline at end of file