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.
Revision 2:a8a800c4f0c3, committed 2022-12-02
- 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;