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.
PVD_Driver.cpp@1:460124e3da18, 2021-11-11 (annotated)
- Committer:
- mgimple
- Date:
- Thu Nov 11 23:03:49 2021 +0000
- Revision:
- 1:460124e3da18
- Child:
- 2:7b9d20c715f5
finally son of a bitch
Who changed what in which revision?
User | Revision | Line number | New 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 | 1:460124e3da18 | 5 | R=10000; |
mgimple | 1:460124e3da18 | 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 | } |