megan gimple / PVD_Driver
Committer:
mgimple
Date:
Sat Nov 13 20:10:19 2021 +0000
Revision:
2:7b9d20c715f5
Parent:
1:460124e3da18
PVD+voltage

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mgimple 1:460124e3da18 1 #include "PVD_Driver.h"
mgimple 1:460124e3da18 2
mgimple 1:460124e3da18 3 PVD::PVD(PinName in1): _in1(in1)
mgimple 1:460124e3da18 4 {
mgimple 2:7b9d20c715f5 5 R=10000;
mgimple 2:7b9d20c715f5 6 V=3.3;
mgimple 1:460124e3da18 7 }
mgimple 1:460124e3da18 8
mgimple 1:460124e3da18 9 float PVD::Res()
mgimple 1:460124e3da18 10 {
mgimple 1:460124e3da18 11 float volt=_in1.read()*3.3;
mgimple 1:460124e3da18 12 float res=((R/volt)-V)/1000;
mgimple 1:460124e3da18 13 return res;
mgimple 1:460124e3da18 14 }
mgimple 2:7b9d20c715f5 15 float PVD::Volt()
mgimple 2:7b9d20c715f5 16 {
mgimple 2:7b9d20c715f5 17 float volt=_in1.read()*3.3;
mgimple 2:7b9d20c715f5 18 return volt;
mgimple 2:7b9d20c715f5 19 }