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@2:18597e0a246f, 2022-12-02 (annotated)
- 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?
User | Revision | Line number | New 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 | } |