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:7b9d20c715f5, committed 2021-11-13
- Comitter:
- mgimple
- Date:
- Sat Nov 13 20:10:19 2021 +0000
- Parent:
- 1:460124e3da18
- Commit message:
- PVD+voltage
Changed in this revision
PVD_Driver.cpp | Show annotated file Show diff for this revision Revisions of this file |
PVD_Driver.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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
--- a/PVD_Driver.h Thu Nov 11 23:03:49 2021 +0000 +++ b/PVD_Driver.h Sat Nov 13 20:10:19 2021 +0000 @@ -10,6 +10,7 @@ PVD(PinName in1); float R,V; float Res(); + float Volt(); private: AnalogIn _in1;