ff

Dependencies:   mbed TextLCD

Files at this revision

API Documentation at this revision

Comitter:
saicharan24
Date:
Sun May 22 16:42:06 2022 +0000
Commit message:
mhydtjrd;

Changed in this revision

TextLCD.lib 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
temp.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun May 22 16:42:06 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun May 22 16:42:06 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/temp.cpp	Sun May 22 16:42:06 2022 +0000
@@ -0,0 +1,32 @@
+#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(0.2);
+            {
+            avg=(avg+a[i]/10);
+            }
+            
+            tempC = ((LM35*3.3)-0.600)*100.0;
+             tempF = (9.0*tempC)/(5.0 + 32.0);
+             lcd.locate(0,0);
+             lcd.printf("temperature");
+             lcd.locate(0,1);
+             lcd.printf("%.2fC%.2fF",tempC,tempF);
+             wait(0.5);
+             }
+             }
+             }
+