works better for long pressed
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
#ifndef DEFINES_H_
|
#ifndef DEFINES_H_
|
||||||
#define DEFINES_H_
|
#define DEFINES_H_
|
||||||
|
|
||||||
#define DEBUG
|
// #define DEBUG
|
||||||
// #define SLEEP
|
// #define SLEEP
|
||||||
|
|
||||||
#define EEPROM_ADDR 0
|
#define EEPROM_ADDR 0
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum { NOT_PRESSED, PRESSED, LONG_PRESSED } tPressedState;
|
typedef enum { NOT_PRESSED, PRESSED, LONG_PRESSED_PREPARE, LONG_PRESSED } tPressedState;
|
||||||
|
|
||||||
|
|
||||||
WiFiClientSecure espClient;
|
WiFiClientSecure espClient;
|
||||||
@ -158,6 +158,9 @@ void loopProduction() {
|
|||||||
state = PRESSED;
|
state = PRESSED;
|
||||||
break;
|
break;
|
||||||
case PRESSED:
|
case PRESSED:
|
||||||
|
state = LONG_PRESSED_PREPARE;
|
||||||
|
break;
|
||||||
|
case LONG_PRESSED_PREPARE:
|
||||||
state = LONG_PRESSED;
|
state = LONG_PRESSED;
|
||||||
client.publish(configBlock.mqttTopic, "LONG_BEGIN");
|
client.publish(configBlock.mqttTopic, "LONG_BEGIN");
|
||||||
break;
|
break;
|
||||||
@ -171,6 +174,7 @@ void loopProduction() {
|
|||||||
case NOT_PRESSED:
|
case NOT_PRESSED:
|
||||||
break;
|
break;
|
||||||
case PRESSED:
|
case PRESSED:
|
||||||
|
case LONG_PRESSED_PREPARE:
|
||||||
client.publish(configBlock.mqttTopic, "SHORT");
|
client.publish(configBlock.mqttTopic, "SHORT");
|
||||||
break;
|
break;
|
||||||
case LONG_PRESSED:
|
case LONG_PRESSED:
|
||||||
|
Reference in New Issue
Block a user