Corrijio 'reanudar'

This commit is contained in:
Arturo Corro 2021-12-18 13:16:42 -06:00
parent a2ca4cb087
commit 2f31f1f4f0
3 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/***************************************** /*****************************************
* Dosificador_LCD2004_4buttons * * Dosificador_LCD2004_4buttons *
* 15/03/2021 * * 18/12/2021 *
* Versión 0.1.0 * * Versión 0.1.0 *
* koneko.mx * * koneko.mx *
*****************************************/ *****************************************/
@ -14,7 +14,7 @@
* PINOUT / MEMORY ADDRESS * PINOUT / MEMORY ADDRESS
**************************************************/ **************************************************/
#define LCD_I2C_ADDRESS 0x27 #define LCD_I2C_ADDRESS 0x27
#define RELAY_PIN 2 #define RELAY_PIN 4
#define SETTINGS_BUTTONS_PIN A2 #define SETTINGS_BUTTONS_PIN A2
/************************************************** /**************************************************
@ -170,6 +170,7 @@
// Leemos valor analogo del botón // Leemos valor analogo del botón
uint16_t button_value = analogRead(SETTINGS_BUTTONS_PIN); uint16_t button_value = analogRead(SETTINGS_BUTTONS_PIN);
// Comprobamos el valor obtenido con un rago de tolerancia SETTING_BUTTON_TOLERANCE_READ // Comprobamos el valor obtenido con un rago de tolerancia SETTING_BUTTON_TOLERANCE_READ
for (uint8_t i = 0; i < sizeof button_values / sizeof button_values[0]; i++) { for (uint8_t i = 0; i < sizeof button_values / sizeof button_values[0]; i++) {
if(button_values[i] >= (button_value - SETTING_BUTTON_TOLERANCE_READ) && button_values[i] <= (button_value + SETTING_BUTTON_TOLERANCE_READ)) if(button_values[i] >= (button_value - SETTING_BUTTON_TOLERANCE_READ) && button_values[i] <= (button_value + SETTING_BUTTON_TOLERANCE_READ))
@ -232,11 +233,12 @@
default: default:
confirmation_repeats_millis = 0; confirmation_repeats_millis = 0;
/*
_bt[0] = 0; _bt[0] = 0;
_bt[1] = 0; _bt[1] = 0;
_bt[2] = 0; _bt[2] = 0;
_bt[3] = 0; _bt[3] = 0;
*/
} }
// Verificamos y salimos del menú si a pasan AUTO_EXIT_MENU_MILLIS // Verificamos y salimos del menú si a pasan AUTO_EXIT_MENU_MILLIS

View File

@ -390,6 +390,9 @@ Timer_lite::~Timer_lite()
EEPROM.write(_eeprom_address_timer_detenido, 0); EEPROM.write(_eeprom_address_timer_detenido, 0);
_fin_de_periodo_seg = _now.unixtime() + _restante_del_periodo_seg; _fin_de_periodo_seg = _now.unixtime() + _restante_del_periodo_seg;
if((_periodo == TIMER_ARRANQUE || _periodo == TIMER_ENCENDIDO) && _fin_de_periodo_seg)
setRelaySatus(RELAY_ON);
} }
void Timer_lite::reiniciar() void Timer_lite::reiniciar()
@ -399,3 +402,4 @@ Timer_lite::~Timer_lite()
_periodo = TIMER_INICIO_ESPERA; _periodo = TIMER_INICIO_ESPERA;
_fin_de_periodo_seg = _now.unixtime() + getTiempoInicioEspera(); _fin_de_periodo_seg = _now.unixtime() + getTiempoInicioEspera();
} }

View File

@ -36,8 +36,8 @@
#define serialBeginWhile(a) do{}while(0) #define serialBeginWhile(a) do{}while(0)
#endif #endif
#define RELAY_OFF HIGH #define RELAY_OFF LOW
#define RELAY_ON LOW #define RELAY_ON HIGH
#define TIMER_DETENIDO 0 #define TIMER_DETENIDO 0
#define TIMER_INICIO_ESPERA 1 #define TIMER_INICIO_ESPERA 1
@ -151,3 +151,4 @@ class Timer_lite
}; };
#endif #endif