projet capteur connecté ST/SE

Dependencies:   HP206C mbed HMC5883L DHT DS1820

Files at this revision

API Documentation at this revision

Comitter:
Fayge
Date:
Tue Sep 25 15:32:21 2018 +0000
Parent:
26:8fc073c2a3a9
Child:
32:6b491b7b75e9
Commit message:
include mbed.h added to H_sol and soil temperature added ( DS1820 lib )

Changed in this revision

DS1820.lib Show annotated file Show diff for this revision Revisions of this file
H_sol.cpp Show annotated file Show diff for this revision Revisions of this file
H_sol.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DS1820.lib	Tue Sep 25 15:32:21 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/Sissors/code/DS1820/#236eb8f8e73a
--- a/H_sol.cpp	Tue Sep 25 13:52:57 2018 +0000
+++ b/H_sol.cpp	Tue Sep 25 15:32:21 2018 +0000
@@ -1,14 +1,7 @@
 //florent
 #include "H_sol.h"
 
-#define LOW_H 160
-#define HIGH_H 520
-
-
-//AnalogIn moisture(A0);//( A0 -> A7 )
-
-double getSoilHumidity(AnalogIn sensor)
-{
-    
-    return ((double)sensor)/((double)3.0);
+float getSoilHumidity(AnalogIn sensor)
+{ 
+    return sensor.read()/((float)3.0);
 }
\ No newline at end of file
--- a/H_sol.h	Tue Sep 25 13:52:57 2018 +0000
+++ b/H_sol.h	Tue Sep 25 15:32:21 2018 +0000
@@ -0,0 +1,12 @@
+#ifndef H_SOL
+#define H_SOL
+
+#include "mbed.h"
+
+#define LOW_H 160
+#define HIGH_H 520
+
+//AnalogIn moisture(A0);//( A0 -> A7 )
+float getSoilHumidity(AnalogIn sensor);
+
+#endif
\ No newline at end of file