This is a Testing library

Committer:
javiersing
Date:
Mon Nov 28 12:58:28 2016 +0000
Revision:
0:ab240102b895
This is a testing library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
javiersing 0:ab240102b895 1 float Moist10HS(AnalogIn moist)
javiersing 0:ab240102b895 2 {
javiersing 0:ab240102b895 3 // SUBSTRATE CALIBRATION: You have to convert the voltage to VWC using soil or substrate specific calibration. Decagon has generic calibrations (check the 10HS manual at http://manuals.decagon.com/Manuals/13508_10HS_Web.pdf) or you can determine your own calibration. We used our own calibration for Fafard 1P (peat: perlite, Conrad Fafard, Inc., Agawam, MA)
javiersing 0:ab240102b895 4 float SubCalSlope = 1.1785;
javiersing 0:ab240102b895 5 float SubCalIntercept = -0.4938;
javiersing 0:ab240102b895 6 float value = moist.read(); // lee el puerto analogico y lo muestra de 0-1V
javiersing 0:ab240102b895 7 float VWC = value * (3.3) * SubCalSlope + SubCalIntercept; // Convert the analog reading (which goes from 0 - 1V)
javiersing 0:ab240102b895 8 return VWC;
javiersing 0:ab240102b895 9 }