Compare commits

...

5 Commits

Author SHA1 Message Date
0cce84016d prepere deployment 2022-04-12 20:04:27 +02:00
6cbdfb4f06 adjusted velues 2022-04-12 19:52:19 +02:00
6d5d05c869 rtfm ... 2022-04-12 19:29:16 +02:00
9c77e77860 prepere for deployment 2022-04-10 19:15:54 +02:00
b161ab7ff7 add delay for redebility 2022-04-10 19:11:25 +02:00
3 changed files with 15 additions and 11 deletions

View File

@@ -1,9 +0,0 @@
[build]
target = "avr-specs/avr-atmega328p.json"
[target.'cfg(target_arch = "avr")']
runner = "ravedude nano -cb 57600"
[unstable]
build-std = ["core"]
build-std-features = ["compiler-builtins-mangled-names"]

View File

@@ -1,6 +1,9 @@
#include <avr/sleep.h>
const int dry = 450; // value for dry sensor
const int wet = 207; // value for wet sensor
float dampPotty;
float onTimePotty;
float solDampness;
@@ -15,13 +18,20 @@ void setup() {
Serial.begin(19200);
digitalWrite(5 , HIGH);
attachInterrupt(0, wakeUp, FALLING);
delay(10);
Serial.println("https://git.sfs.ddnss.org/Erik/garden-watering-controller.git");
delay(100);
Serial.print("Soll foichtigkeit: ");
Serial.println(calculateTargetDampness(), 4);
Serial.print("Ist feuchtigkeit: ");
Serial.println(calculateDampness(),4 );
}
// the loop function runs over and over again forever
void loop() {
Serial.print("Licht Sensor");
Serial.println(digitalRead(2));
delay(20);
bedTimeYet();
@@ -30,7 +40,7 @@ void loop() {
Serial.println(calculateTargetDampness() , 4);
Serial.println(calculatePumpOnTime() , 4);
Serial.println(calculateDampness(), 4);
pumpOffTime(1);
pumpOffTime(30);
wateringTheGarden();
}
@@ -46,7 +56,9 @@ float calculatePumpOnTime() {
float calculateDampness() {
solDampness = analogRead(A0);
return solDampness / 500;
float percentageHumididy = (map(solDampness, wet, dry, 100, 0));
percentageHumididy = percentageHumididy *0.01;
return percentageHumididy;
}
void sleep() {

View File

@@ -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);
}