Lucy Damon / LM19_Driver2

Files at this revision

API Documentation at this revision

Comitter:
lucydamon
Date:
Fri Dec 02 00:19:49 2022 +0000
Parent:
1:101ffcb3157f
Commit message:
added some code to read temperature outputs and voltage- NOTE temperature readings are not correct due to the incorrect temperature equation- I still cannot figure out correct equation.

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
--- a/LM19_Driver.cpp	Thu Dec 01 23:58:06 2022 +0000
+++ b/LM19_Driver.cpp	Fri Dec 02 00:19:49 2022 +0000
@@ -9,6 +9,13 @@
 
 }
 
+float LM19::temp()
+{
+    float temp=_in1.read()*3.3;
+    return temp;
+
+}
+
 float LM19::volt()
 {
     float volt=_in1.read()*3.3;
--- a/LM19_Driver.h	Thu Dec 01 23:58:06 2022 +0000
+++ b/LM19_Driver.h	Fri Dec 02 00:19:49 2022 +0000
@@ -9,7 +9,8 @@
 public:
     LM19(PinName in1);          
     float c1, c2, c3, c4;       
-    float volt();               
+    float temp();  
+    float volt();             
 
 private:
     AnalogIn _in1;