Testing

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
m211374
Date:
Wed Apr 10 23:48:39 2019 +0000
Commit message:
gfdfg

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	Wed Apr 10 23:48:39 2019 +0000
@@ -0,0 +1,45 @@
+//ES202_Temp_Lab.m
+//This program will read temperature from a sensor and read the output over time
+//MIDN Finnegan and MIDN Lenning Davis
+//1-10-2019
+
+#include "mbed.h"
+
+Serial pc(USBTX,USBRX);
+AnalogIn sensor(p17); 
+PwmOut led(LED1);
+
+float far = 0.0;
+int samples = 0;
+float rate = 0.0; 
+int counter = 0;
+float kel = 0.0; 
+float cel = 0.0;
+
+
+int main(void)
+{
+    while(1)
+    {
+        pc.scanf("%d, %f",&samples,&rate);
+        while(counter < samples)
+        {
+            far = sensor * 100 *3.3;
+            cel = (far - 32)*.5556;
+            kel = cel + 273.15;
+            counter = counter + 1; 
+            pc.printf("%d, %f \n", counter, far);
+            wait(rate);
+        }
+        counter = 0;
+    }
+}
+            
+            
+            
+            
+            
+        
+        
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 10 23:48:39 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file