Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:aed747a24dcd, committed 2013-05-08
- Comitter:
- GRG
- Date:
- Wed May 08 08:57:08 2013 +0000
- Commit message:
- LM35 with LCD
Changed in this revision
diff -r 000000000000 -r aed747a24dcd TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Wed May 08 08:57:08 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
diff -r 000000000000 -r aed747a24dcd main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed May 08 08:57:08 2013 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+AnalogIn LM35(p15);
+
+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 aed747a24dcd mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 08 08:57:08 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd \ No newline at end of file