Korekta czasów i setupu
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_SSD1306.h>
|
||||
#define Version "0.1"
|
||||
#define Version "0.2"
|
||||
#define SCREEN_WIDTH 128
|
||||
#define SCREEN_HEIGHT 32
|
||||
#define OLED_RESET -1
|
||||
@@ -24,13 +24,13 @@ int moisture = 0;
|
||||
int watertingCnt = 0;
|
||||
int minValue = 5000;
|
||||
int maxValue = 0;
|
||||
int waitSec = 16;
|
||||
int waitSec = 96;
|
||||
int waitMs = 1000 * waitSec;
|
||||
|
||||
void setup() {
|
||||
pinMode(WTR_SENSOR, INPUT_PULLDOWN);
|
||||
pinMode(PIN_PUMP, OUTPUT);
|
||||
digitalWrite(PIN_PUMP, LOW);
|
||||
digitalWrite(PIN_PUMP, HIGH);
|
||||
Serial.begin(9600);
|
||||
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
|
||||
Serial.println(F("SSD1306 allocation failed"));
|
||||
@@ -98,7 +98,7 @@ if (moisture < minValue){
|
||||
Serial.println("Status: Soil is too dry - time to water!");
|
||||
digitalWrite(PIN_PUMP, LOW);
|
||||
watertingCnt++;
|
||||
delay(waitMs/4);
|
||||
delay(waitMs/16);
|
||||
digitalWrite(PIN_PUMP, HIGH);
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
Reference in New Issue
Block a user