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.
LM19_Driver.cpp@0:876059873ad6, 2021-11-10 (annotated)
- Committer:
- mackenziefraser
- Date:
- Wed Nov 10 15:13:35 2021 +0000
- Revision:
- 0:876059873ad6
- Child:
- 1:6249f99332e0
LM19 driver file; create initialization function; define inputs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mackenziefraser | 0:876059873ad6 | 1 | #include "LM19_Driver.h" |
mackenziefraser | 0:876059873ad6 | 2 | |
mackenziefraser | 0:876059873ad6 | 3 | LM19::LM19(PinName in1): _in1(in1) { |
mackenziefraser | 0:876059873ad6 | 4 | c1 = -1481.96; |
mackenziefraser | 0:876059873ad6 | 5 | c2 = 2.1962*1000000.000; |
mackenziefraser | 0:876059873ad6 | 6 | c3 = 1.8636; |
mackenziefraser | 0:876059873ad6 | 7 | c4 = 3.88/1000000.000; |
mackenziefraser | 0:876059873ad6 | 8 | } |
mackenziefraser | 0:876059873ad6 | 9 | |
mackenziefraser | 0:876059873ad6 | 10 | float LM19::temp(){ |
mackenziefraser | 0:876059873ad6 | 11 | float volt=_in1.read()*3.3; |
mackenziefraser | 0:876059873ad6 | 12 | float T=c1+sqrt(c2 + (c3-volt)/c4); |
mackenziefraser | 0:876059873ad6 | 13 | return T; |
mackenziefraser | 0:876059873ad6 | 14 | } |