megan gimple / PVD_Driver
Revision:
2:7b9d20c715f5
Parent:
1:460124e3da18
--- a/PVD_Driver.cpp	Thu Nov 11 23:03:49 2021 +0000
+++ b/PVD_Driver.cpp	Sat Nov 13 20:10:19 2021 +0000
@@ -2,8 +2,8 @@
 
 PVD::PVD(PinName in1): _in1(in1)
 {
-        R=10000;
-        V=3.3;
+    R=10000;
+    V=3.3;
 }
 
 float PVD::Res()
@@ -12,3 +12,8 @@
     float res=((R/volt)-V)/1000;
     return res;
 }
+float PVD::Volt()
+{
+    float volt=_in1.read()*3.3;
+    return volt;
+}
\ No newline at end of file