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.
Diff: LM19_Driver.cpp
- Revision:
- 1:6249f99332e0
- Parent:
- 0:876059873ad6
diff -r 876059873ad6 -r 6249f99332e0 LM19_Driver.cpp
--- a/LM19_Driver.cpp Wed Nov 10 15:13:35 2021 +0000
+++ b/LM19_Driver.cpp Fri Nov 12 01:56:04 2021 +0000
@@ -1,7 +1,11 @@
+//Mackenzie Fraser
+//Assignment 4.1
+//Initialization function/inputs file
+
#include "LM19_Driver.h"
-LM19::LM19(PinName in1): _in1(in1) {
- c1 = -1481.96;
+LM19::LM19(PinName in1): _in1(in1) {
+ c1 = -1481.96; //set coefficient values
c2 = 2.1962*1000000.000;
c3 = 1.8636;
c4 = 3.88/1000000.000;
@@ -9,6 +13,11 @@
float LM19::temp(){
float volt=_in1.read()*3.3;
- float T=c1+sqrt(c2 + (c3-volt)/c4);
+ float T=c1+sqrt(c2 + (c3-volt)/c4); //temperature computing function
return T;
+}
+
+float LM19::voltage(){
+ float V=_in1.read()*3.3;
+ return V;
}
\ No newline at end of file