Disabled button
This commit is contained in:
16
src/main.cpp
16
src/main.cpp
@@ -10,7 +10,7 @@
|
|||||||
//const int echoPin = D2;
|
//const int echoPin = D2;
|
||||||
const int relayPin = D1;
|
const int relayPin = D1;
|
||||||
const int contactPin = D2;
|
const int contactPin = D2;
|
||||||
const int buttonPin = D6;
|
// const int buttonPin = D6;
|
||||||
const int dhtPin = D7; ;
|
const int dhtPin = D7; ;
|
||||||
const int ledPin = LED_BUILTIN;
|
const int ledPin = LED_BUILTIN;
|
||||||
const int heartbeatPin = LED_BUILTIN;
|
const int heartbeatPin = LED_BUILTIN;
|
||||||
@@ -22,7 +22,7 @@ bool relayInverse = true;
|
|||||||
//PingNode obstacleNode("obstacle",trigPin,echoPin);
|
//PingNode obstacleNode("obstacle",trigPin,echoPin);
|
||||||
DHT22Node airNode("air",dhtPin,TEMPERATURE_INTERVAL);
|
DHT22Node airNode("air",dhtPin,TEMPERATURE_INTERVAL);
|
||||||
RelayNode relayNode("relay",relayPin,ledPin,relayInverse);
|
RelayNode relayNode("relay",relayPin,ledPin,relayInverse);
|
||||||
ButtonNode buttonNode("button",buttonPin);
|
// ButtonNode buttonNode("button",buttonPin);
|
||||||
ContactNode contactNode("contact",contactPin);
|
ContactNode contactNode("contact",contactPin);
|
||||||
Heartbeater heartbeater(heartbeatPin, heartbeatPin == LED_BUILTIN ? LOW : HIGH);
|
Heartbeater heartbeater(heartbeatPin, heartbeatPin == LED_BUILTIN ? LOW : HIGH);
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@ void changeHandler() {
|
|||||||
signal_led();
|
signal_led();
|
||||||
}
|
}
|
||||||
|
|
||||||
void buttonChangeHandler(bool down) {
|
// void buttonChangeHandler(bool down) {
|
||||||
Homie.getLogger() << "Button changing relay to " << (down ? "on" : "off") << endl;
|
// Homie.getLogger() << "Button changing relay to " << (down ? "on" : "off") << endl;
|
||||||
relayNode.setRelay(down);
|
// relayNode.setRelay(down);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void loopHandler() {
|
void loopHandler() {
|
||||||
heartbeater.loop();
|
heartbeater.loop();
|
||||||
@@ -52,10 +52,10 @@ void setup() {
|
|||||||
pinMode(ledPin, OUTPUT);
|
pinMode(ledPin, OUTPUT);
|
||||||
|
|
||||||
Homie_setBrand("EtxeanIoT");
|
Homie_setBrand("EtxeanIoT");
|
||||||
Homie_setFirmware("etxean-garagesensor", "1.2.4");
|
Homie_setFirmware("etxean-garagesensor", "1.3.0");
|
||||||
Homie.setLoopFunction(loopHandler);
|
Homie.setLoopFunction(loopHandler);
|
||||||
// obstacleNode.setChangeHandler(changeHandler);
|
// obstacleNode.setChangeHandler(changeHandler);
|
||||||
buttonNode.onChange(buttonChangeHandler);
|
// buttonNode.onChange(buttonChangeHandler);
|
||||||
Homie.setup();
|
Homie.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user