Dateien nach "/" hochladen
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
|
||||
int sensorPin = sensorMoisturePin; // siehe pins.h
|
||||
int sensorValue;
|
||||
|
||||
int dryAnalogValue = 4095;
|
||||
|
||||
int wetAnalogValue = 1023;
|
||||
int DryValuePercent = 0;
|
||||
int WetValuepercent = 100;
|
||||
|
||||
int moistureValuePercent;
|
||||
|
||||
int sensor_moisture_value;
|
||||
void setupHumidity() {
|
||||
Serial.print("Setting up Humidity");
|
||||
}
|
||||
void getHumidity() {
|
||||
|
||||
if (sensorValue = analogRead(sensorPin)) {
|
||||
Serial.print("Analog moisture Value : ");
|
||||
Serial.println(sensorValue);
|
||||
moistureValuePercent = map(sensorValue, dryAnalogValue, wetAnalogValue, DryValuePercent, WetValuepercent);
|
||||
Serial.print("moisture percent: ");
|
||||
Serial.print(moistureValuePercent);
|
||||
Serial.println("%");
|
||||
if (moistureValuePercent < DryValuePercent) {
|
||||
Serial.println("plant is dry !! ");
|
||||
}
|
||||
sensor_moisture_value = moistureValuePercent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user