Lucy Damon / PDV_Driver2

Files at this revision

API Documentation at this revision

Comitter:
lucydamon
Date:
Fri Dec 02 00:20:59 2022 +0000
Parent:
1:9f63f70d68fa
Commit message:
Added photocell code so it can be used in main code

Changed in this revision

PDV_Driver.cpp Show annotated file Show diff for this revision Revisions of this file
PDV_Driver.h Show annotated file Show diff for this revision Revisions of this file
--- a/PDV_Driver.cpp	Thu Dec 01 23:58:11 2022 +0000
+++ b/PDV_Driver.cpp	Fri Dec 02 00:20:59 2022 +0000
@@ -9,9 +9,21 @@
 
 }
 
+float PDV::photocell()
+{
+    float photocell=_in1.read()*3.3;
+    return photocell;
+
+}
 float PDV::resistance()
 {
     float resistance=_in1.read()*3.3;
     return resistance;
 
+}
+float PDV::volt()
+{
+    float volt=_in1.read()*3.3;
+    return volt;
+
 }
\ No newline at end of file
--- a/PDV_Driver.h	Thu Dec 01 23:58:11 2022 +0000
+++ b/PDV_Driver.h	Fri Dec 02 00:20:59 2022 +0000
@@ -9,7 +9,9 @@
 public:
     PDV(PinName in1);           
     float c1, c2, c3, c4;       
-    float resistance();         
+    float photocell();     
+    float resistance();    
+    float volt();
 
 private:
     AnalogIn _in1;