Dependencies:   mbed-STM32F103C8T6 mbed

Files at this revision

API Documentation at this revision

Comitter:
AbiOne
Date:
Sat Jun 09 01:15:49 2018 +0000
Parent:
2:38c1190c9ac7
Commit message:
1.1 Measurement soil moisture once at 10 minutes and send value in percent to COM port

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jun 08 16:22:39 2018 +0000
+++ b/main.cpp	Sat Jun 09 01:15:49 2018 +0000
@@ -12,19 +12,22 @@
 int main()
 {
     float meas;
-    float very_hum_value = 0.30;
+    float very_hum_value = 0.27;
     float soil_hum_perc;
-    
-     
+         
     AnalogIn analog_value(A0);
-    
+    DigitalOut VCC(PB_7);
     
     while(1) {
+       
+        VCC = 1;// VCC on
         wait(1);
         meas = analog_value.read();
+        VCC = 0; //VCC of
         
         soil_hum_perc = (1 - (meas - very_hum_value)/(1 - very_hum_value)) * 100; // perevod v %
-        pc.printf("Soil_Humidity: %f %\n", soil_hum_perc);
-        //myled = !myled;
+        pc.printf("Soil_Humidity: %f %% \n", soil_hum_perc);
+        
+        wait(600); //period izmereniy
     }
 }