Lucy Damon / LM19_Driver2
Committer:
lucydamon
Date:
Fri Dec 02 00:19:49 2022 +0000
Revision:
2:18597e0a246f
Parent:
1:101ffcb3157f
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.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lucydamon 1:101ffcb3157f 1 #include "LM19_Driver.h"
lucydamon 0:929925da937d 2
lucydamon 0:929925da937d 3 LM19::LM19(PinName in1): _in1(in1)
lucydamon 0:929925da937d 4 {
lucydamon 0:929925da937d 5 c1 = -1481.96;
lucydamon 0:929925da937d 6 c2 = 2.1962*1000000.000;
lucydamon 0:929925da937d 7 c3 = 1.8636;
lucydamon 0:929925da937d 8 c4 = 3.88/1000000.000;
lucydamon 0:929925da937d 9
lucydamon 0:929925da937d 10 }
lucydamon 0:929925da937d 11
lucydamon 2:18597e0a246f 12 float LM19::temp()
lucydamon 2:18597e0a246f 13 {
lucydamon 2:18597e0a246f 14 float temp=_in1.read()*3.3;
lucydamon 2:18597e0a246f 15 return temp;
lucydamon 2:18597e0a246f 16
lucydamon 2:18597e0a246f 17 }
lucydamon 2:18597e0a246f 18
lucydamon 0:929925da937d 19 float LM19::volt()
lucydamon 0:929925da937d 20 {
lucydamon 0:929925da937d 21 float volt=_in1.read()*3.3;
lucydamon 0:929925da937d 22 return volt;
lucydamon 0:929925da937d 23
lucydamon 0:929925da937d 24 }