SANTENO / MKL

Motorklappe - an arduino controlled door to let roomba robots out and in a kitchen counter.
GNU General Public License v3.0
0 stars 0 forks source link

MKL:add a watchdow timer to reset board automatically #8

Closed SANTENO closed 2 years ago

SANTENO commented 2 years ago

A watchdog is required if the system crashes to recover.

SANTENO commented 2 years ago

include "Watchdog.h" //Arduino watchdog timer for system reset //Issue#8

.. instance creation - Watchdog MyDog; //Issue#8

setup: ... MyDog.enable(Watchdog::TIMEOUT_8S);

void: MyDog.reset(); at end of statemachine

in all manual up/downs:--> Mode 6

while ((digitalRead(BTN_UP) == 0) ) { //Hochfahren bei gedrücktem Schalter mysteps = MMklappe1.readstepcount(); MyDog.reset(); if (mysteps <= MAXSTEP){ MMklappe1.stepdrive(OPEN); }

SANTENO commented 2 years ago

Tested and forced up/down with display error -- did reset and then started again!

SANTENO commented 2 years ago

committed