From 41b46fc95293dbe6a1a5ea9c58d4985427cdeb34 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 15 Mar 2018 16:58:17 +0100 Subject: [PATCH] disable PIR --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 711553a..ff382e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,7 +90,7 @@ void setup() { // rtc_gpio_deinit((gpio_num_t)buttonPin); pinMode(buttonPin, INPUT_PULLUP); // rtc_gpio_deinit((gpio_num_t)sensorPin); - pinMode(sensorPin, INPUT); + pinMode(sensorPin, INPUT_PULLUP); pinMode(18, OUTPUT); digitalWrite(18, HIGH); // disable LoRa_CS @@ -454,10 +454,10 @@ void loop() Serial.print("Free Heap: "); Serial.println(ESP.getFreeHeap()); - if (sensorON && digitalRead(sensorPin) == LOW) { +/* if (sensorON && digitalRead(sensorPin) == LOW) { uint16_t statusPacketIdSub = iot.mqtt.publish(sensorTopic.c_str(), 0, false, "OFF"); sensorON = false; - } + } */ // Send a packet udp.beginMulticastPacket(); @@ -466,13 +466,13 @@ void loop() } - if (digitalRead(sensorPin) == HIGH) { +/* if (digitalRead(sensorPin) == HIGH) { lastActive = millis(); if (sensorON == false && digitalRead(sensorPin) == HIGH) { uint16_t statusPacketIdSub = iot.mqtt.publish(sensorTopic.c_str(), 0, false, timeStr); sensorON = true; } - } + } */ if(millis() - lastTransmit >= 60*1000) { lastTransmit = millis();