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
- Committer:
- mackenziefraser
- Date:
- 2021-11-12
- Revision:
- 1:56c7ec2f6ce5
- Parent:
- 0:876059873ad6
File content as of revision 1:56c7ec2f6ce5:
//Mackenzie Fraser
//Assignment 4.1
//Initialization function/inputs file
#include "LM19_Driver.h"
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;
}
float LM19::temp(){
float volt=_in1.read()*3.3;
float T=c1+sqrt(c2 + (c3-volt)/c4); //temperature computing function
return T;
}
float LM19::voltage(){
float V=_in1.read()*3.3;
return V;
}