1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sunghunKim
Date:
Sun Mar 07 12:04:37 2021 +0000
Commit message:
2

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
diff -r 000000000000 -r d039f36b5a64 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Mar 07 12:04:37 2021 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+ 
+// Initialize a pins to perform analog input and digital output fucntions
+AnalogIn   temperature1(A0);
+AnalogIn   humadity1(A1);
+AnalogIn   temperature2(A2);
+AnalogIn   humadity2(A3);
+AnalogIn   co2(A4);
+ 
+int main(void)
+{
+    while (1) {
+        
+        // 10v analog output
+        printf("t1: %3.1f\t", temperature1.read() * 44.0f);
+        printf("h1: %3.1f\t", humadity1.read() * 90.0f);
+        
+        // 5v analog output
+        printf("t2: %3.1f\t", temperature2.read() * 48.0f);
+        printf("h2: %3.1f\t", humadity2.read() * 115.0f);
+        
+        printf("co2: %3.1f\n", co2.read() * 100.0f);
+        wait(0.2f);            
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r d039f36b5a64 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Mar 07 12:04:37 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file