Mark Schwarzer / LM19_Driver

Files at this revision

API Documentation at this revision

Comitter:
markschwarzer
Date:
Mon Nov 09 14:25:38 2020 +0000
Commit message:
logged data to SD card

Changed in this revision

LM19_Driver.cpp Show annotated file Show diff for this revision Revisions of this file
LM19_Driver.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LM19_Driver.cpp	Mon Nov 09 14:25:38 2020 +0000
@@ -0,0 +1,13 @@
+#include "LM19_Driver.h"
+
+LM19::LM19(PinName in1): _in1(in1) {
+    c1= -1481.96;
+    c2= 2.1962*1000000.000;
+    c3= 1.8636;
+    c4= 3.88/1000000.000;
+    }
+float LM19::temp(){
+    float volt=_in1.read()*3.3;
+    float T=c1+sqrt(c2+ (c3-volt)/c4);
+    return T;
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LM19_Driver.h	Mon Nov 09 14:25:38 2020 +0000
@@ -0,0 +1,16 @@
+#ifndef LM19_Driver_h
+#define LM19_Driver_h
+#include "mbed.h"
+
+class LM19{
+    
+    public:
+    LM19(PinName in1);
+    float c1, c2, c3, c4;
+    float temp();
+    
+    private:
+    AnalogIn _in1;
+    
+    };
+#endif
\ No newline at end of file