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.
Dependencies: mbed-STM32F103C8T6 mbed
Revision 3:6a2c1d1cc937, committed 2018-06-09
- 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
}
}