Ohms law basic calculations for calculating R2 in voltage divider when R1 is known and to calculate voltage drop ratio when both R1 and R2 are known.
Diff: ohms.cpp
- Revision:
- 3:b4592b0ae1e3
- Parent:
- 0:fe642275688d
diff -r fe642275688d -r b4592b0ae1e3 ohms.cpp --- a/ohms.cpp Mon Mar 07 23:27:37 2016 +0000 +++ b/ohms.cpp Sat Apr 02 03:48:37 2016 +0000 @@ -1,6 +1,14 @@ #include "mbed.h" -//#include "ohms.h" + +/* By Joseph Ellsworth CTO of A2WH + Take a look at A2WH.com Producing Water from Air using Solar Energy + March-2016 License: https://developer.mbed.org/handbook/MIT-Licence + Please contact us http://a2wh.com for help with custom design projects. + +*/ + +#include "ohms.h" float volDivideCalcRatio(long r1, long r2) { return ((float) r2 / (float) (r1 + r2)); @@ -11,8 +19,6 @@ } - - long calcResistV(long refResistR1, float maxV, float measuredV) { float VDrop = maxV - measuredV; float dropRatio = measuredV / VDrop;