-
-
Save arilop1994/1cc2b2c2f20e85fdc67dc179641285a8 to your computer and use it in GitHub Desktop.
Watchdog Arduino
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() | |
{ | |
wdt_reset(); // Actualizar el watchdog para que no produzca un reinicio | |
//Aquí iría el código de tu programa | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment