This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/wdt.h> // Incluir la librería que contiene el watchdog (wdt.h) | |
void setup() | |
{ | |
wdt_disable(); // Desactivar el watchdog mientras se configura, para que no se resetee | |
wdt_enable(WDTO_4S); // Configurar watchdog a cuatro segundos | |
// Puedes usar el tiempo que te convenga de la lista de arriba | |
} | |
void loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//rtc.setDateTime(dt); //Establece fecha y hora cargada en "dt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
lcd.begin(84, 48); | |
Serial.begin(115200); // Abre el puerto serie para mostrar valores leídos | |
Wire.begin(); //Inicializa la comunicacion con el RTC | |
rtc.begin(); //Inicializa el RTC | |
rtc.setDateTime(dt); //Establece fecha y hora cargada en "dt" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char weekDay[][4] = {"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab" }; | |
static PCD8544 lcd; | |
//año, mes, dia, hora, minutos, segundos y dia de la semana (0=Domingo hasta 6=Sabado) | |
//Si se escribe una hora o fecha inexistente se puede interferir con la normal operación del RTC | |
DateTime dt(2019, 2, 7, 15, 58, 0, 4); //año, mes, dia, hora, min, seg, diasem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include "Sodaq_DS3231.h" | |
#include <PCD8544.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include "Sodaq_DS3231.h" | |
#include <PCD8544.h> | |
char weekDay[][4] = {"Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab" }; | |
static PCD8544 lcd; | |
//año, mes, dia, hora, minutos, segundos y dia de la semana (0=Domingo hasta 6=Sabado) | |
//Si se escribe una hora o fecha inexistente se puede interferir con la normal operación del RTC | |
DateTime dt(2019, 2, 7, 15, 58, 0, 4); //año, mes, dia, hora, min, seg, diasem |