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:20d11ef1b1a6, committed 2022-05-22
- Comitter:
- hughbellinger
- Date:
- Sun May 22 20:18:58 2022 +0000
- Commit message:
- 1
Changed in this revision
| 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun May 22 20:18:58 2022 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+AnalogIn LM35(p18);
+
+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(2);
+ }
+ 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);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 22 20:18:58 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file