Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
RubenHendriks
Date:
Thu Nov 27 10:40:19 2014 +0000
Commit message:
LCD;

Changed in this revision

TextLCD.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
diff -r 000000000000 -r 84a44df9cf01 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu Nov 27 10:40:19 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 84a44df9cf01 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 27 10:40:19 2014 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "TextLCD.h"
+ 
+AnalogIn LM35(p20);
+ 
+TextLCD lcd(p21,p22,p23,p24,p25,p26);
+ 
+int main()
+{
+ float tempC,tempF,a[10],avg;
+ int i;
+ 
+ while(1)
+ {
+ 
+ avg=0;
+for(i=0;i<10;i++)
+{
+a[i]=LM35.read();
+wait(.02);
+}
+for(i=0;i<10;i++)
+{
+avg=avg+(a[i]/10);
+}
+ 
+ 
+tempC=(avg*3.685503686*100);
+tempF=(9.0*tempC)/5.0 + 32.0;
+lcd.locate(0,0);
+lcd.printf("  Temperature   ");
+lcd.locate(0,1);
+lcd.printf("%.2f C %.2f F",tempC,tempF);
+ 
+wait(.5);      
+    }
+ }
\ No newline at end of file
diff -r 000000000000 -r 84a44df9cf01 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 27 10:40:19 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file