add new pins for heizung
This commit is contained in:
parent
3aff2a69aa
commit
e0a27bf155
23
src/main.cpp
23
src/main.cpp
@ -14,6 +14,7 @@ static const uint8_t WasserSensorPin = D5; // GPIO 14
|
|||||||
static const uint8_t DruckSensorPin = D6; // GPIO 12
|
static const uint8_t DruckSensorPin = D6; // GPIO 12
|
||||||
static const uint8_t SchuetzPin = D2; // GPIO 4
|
static const uint8_t SchuetzPin = D2; // GPIO 4
|
||||||
static const uint8_t LuefterPin = D3; // GPIO 0
|
static const uint8_t LuefterPin = D3; // GPIO 0
|
||||||
|
static const uint8_t HeizungPin = D1;
|
||||||
|
|
||||||
/** time config */
|
/** time config */
|
||||||
static const int maxpumpdauer = 600; //sek
|
static const int maxpumpdauer = 600; //sek
|
||||||
@ -24,6 +25,9 @@ Ticker status;
|
|||||||
//pumpendauer maximum ticker
|
//pumpendauer maximum ticker
|
||||||
Ticker pumpendauer;
|
Ticker pumpendauer;
|
||||||
|
|
||||||
|
Ticker heizung;
|
||||||
|
Ticker luefter;
|
||||||
|
|
||||||
WifiManager mang;
|
WifiManager mang;
|
||||||
|
|
||||||
long turnontime = -1;
|
long turnontime = -1;
|
||||||
@ -133,18 +137,22 @@ ICACHE_RAM_ATTR void WasserSensorInt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
// set pins as output
|
||||||
pinMode(SchuetzPin, OUTPUT);
|
pinMode(SchuetzPin, OUTPUT);
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
pinMode(LuefterPin, OUTPUT);
|
pinMode(LuefterPin, OUTPUT);
|
||||||
|
pinMode(HeizungPin, OUTPUT);
|
||||||
digitalWrite(LED_BUILTIN, LOW);
|
|
||||||
digitalWrite(SchuetzPin, LOW); //pumpe anfangs sofort abschalten
|
|
||||||
digitalWrite(LuefterPin, LOW);
|
|
||||||
|
|
||||||
pinMode(WasserSensorPin, INPUT);
|
pinMode(WasserSensorPin, INPUT);
|
||||||
pinMode(DruckSensorPin, INPUT);
|
pinMode(DruckSensorPin, INPUT);
|
||||||
|
|
||||||
|
// initialize pins
|
||||||
|
digitalWrite(LED_BUILTIN, LOW);
|
||||||
|
digitalWrite(SchuetzPin, LOW); //pumpe anfangs sofort abschalten
|
||||||
|
digitalWrite(LuefterPin, LOW);
|
||||||
|
digitalWrite(HeizungPin, LOW);
|
||||||
|
|
||||||
|
// initilize serial connection
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
Serial.println("\n\n\n\nstartup of ESP");
|
Serial.println("\n\n\n\nstartup of ESP");
|
||||||
Serial.print("Version: ");
|
Serial.print("Version: ");
|
||||||
@ -164,16 +172,17 @@ void setup() {
|
|||||||
DruckschalterInt();
|
DruckschalterInt();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//anhängen der Pin-Interrupts
|
//anhängen der Pin-Interrupts
|
||||||
attachInterrupt(digitalPinToInterrupt(DruckSensorPin), DruckschalterInt, CHANGE);
|
attachInterrupt(digitalPinToInterrupt(DruckSensorPin), DruckschalterInt, CHANGE);
|
||||||
attachInterrupt(digitalPinToInterrupt(WasserSensorPin), WasserSensorInt, CHANGE);
|
attachInterrupt(digitalPinToInterrupt(WasserSensorPin), WasserSensorInt, CHANGE);
|
||||||
|
|
||||||
|
|
||||||
|
// initialize wifi
|
||||||
|
mang.init();
|
||||||
|
|
||||||
Serial.println("startup sequence complete!\n");
|
Serial.println("startup sequence complete!\n");
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_BUILTIN, HIGH);
|
||||||
|
|
||||||
|
|
||||||
mang.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user