rtfm ...
This commit is contained in:
parent
9c77e77860
commit
6d5d05c869
@ -1,6 +1,9 @@
|
|||||||
#include <avr/sleep.h>
|
#include <avr/sleep.h>
|
||||||
|
|
||||||
|
|
||||||
|
const int dry = 459; // value for dry sensor
|
||||||
|
const int wet = 214; // value for wet sensor
|
||||||
|
|
||||||
float dampPotty;
|
float dampPotty;
|
||||||
float onTimePotty;
|
float onTimePotty;
|
||||||
float solDampness;
|
float solDampness;
|
||||||
@ -24,6 +27,7 @@ void setup() {
|
|||||||
|
|
||||||
// the loop function runs over and over again forever
|
// the loop function runs over and over again forever
|
||||||
void loop() {
|
void loop() {
|
||||||
|
Serial.print("Licht Sensor");
|
||||||
Serial.println(digitalRead(2));
|
Serial.println(digitalRead(2));
|
||||||
delay(20);
|
delay(20);
|
||||||
bedTimeYet();
|
bedTimeYet();
|
||||||
@ -48,7 +52,8 @@ float calculatePumpOnTime() {
|
|||||||
|
|
||||||
float calculateDampness() {
|
float calculateDampness() {
|
||||||
solDampness = analogRead(A0);
|
solDampness = analogRead(A0);
|
||||||
return solDampness / 500;
|
float percentageHumididy = map(solDampness, wet, dry, 100, 0)/100;
|
||||||
|
return percentageHumididy;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sleep() {
|
void sleep() {
|
||||||
|
@ -13,6 +13,7 @@ void loop() {
|
|||||||
delay(200);
|
delay(200);
|
||||||
Serial.println(analogRead(A4));
|
Serial.println(analogRead(A4));
|
||||||
Serial.println(analogRead(A2));
|
Serial.println(analogRead(A2));
|
||||||
|
Serial.print("Dampness Sensor: ");
|
||||||
Serial.println(analogRead(A0));
|
Serial.println(analogRead(A0));
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user