Chris Styles
/
apps-shield-pots
Test program for mbed app shield pots
Fork of mbed-app-shield by
Revision 1:e50da1f1f653, committed 2014-01-08
- Comitter:
- chris
- Date:
- Wed Jan 08 16:58:55 2014 +0000
- Parent:
- 0:cca95aa94e09
- Child:
- 2:989f84939300
- Commit message:
- added Temp Accelerometer;
Changed in this revision
--- a/C12832_lcd_fork.lib Wed Jan 08 01:19:09 2014 +0000 +++ b/C12832_lcd_fork.lib Wed Jan 08 16:58:55 2014 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/chris/code/C12832_lcd_fork/#8a9cad03124b +https://mbed.org/users/chris/code/C12832_lcd_fork/#b834d587bf45
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM75B.lib Wed Jan 08 16:58:55 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/neilt6/code/LM75B/#fc27dc535ea9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Wed Jan 08 16:58:55 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MMA7660/#a8e20db7901e
--- 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++; } +*/ + + + }