From 6d5d05c8696365f03e8e637323c541f1e287179f Mon Sep 17 00:00:00 2001 From: xTechnoErikx Date: Tue, 12 Apr 2022 19:29:16 +0200 Subject: [PATCH] rtfm ... --- src/arduinoNano/arduinoNano.ino | 7 ++++++- src/calibrateSleep/calibrateSleep.ino | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/arduinoNano/arduinoNano.ino b/src/arduinoNano/arduinoNano.ino index 7a684e8..9b0be2c 100644 --- a/src/arduinoNano/arduinoNano.ino +++ b/src/arduinoNano/arduinoNano.ino @@ -1,6 +1,9 @@ #include +const int dry = 459; // value for dry sensor +const int wet = 214; // value for wet sensor + float dampPotty; float onTimePotty; float solDampness; @@ -24,6 +27,7 @@ void setup() { // the loop function runs over and over again forever void loop() { + Serial.print("Licht Sensor"); Serial.println(digitalRead(2)); delay(20); bedTimeYet(); @@ -48,7 +52,8 @@ float calculatePumpOnTime() { float calculateDampness() { solDampness = analogRead(A0); - return solDampness / 500; + float percentageHumididy = map(solDampness, wet, dry, 100, 0)/100; + return percentageHumididy; } void sleep() { diff --git a/src/calibrateSleep/calibrateSleep.ino b/src/calibrateSleep/calibrateSleep.ino index ff0a6e0..c02a7da 100644 --- a/src/calibrateSleep/calibrateSleep.ino +++ b/src/calibrateSleep/calibrateSleep.ino @@ -13,6 +13,7 @@ void loop() { delay(200); Serial.println(analogRead(A4)); Serial.println(analogRead(A2)); + Serial.print("Dampness Sensor: "); Serial.println(analogRead(A0)); delay(1000); }