Arduino/Make/フィジカルコンピューティング/電子工作あたりで活動しています。スタバの空きカップを使ったスタバカップアンプなど製作。最近はもっぱらArduinoと3Dプリンタの自作に興味があります。 Arduinoでウォッチドッグタイマを使うにはavr/wdt.hをインクルードし、wdt_enable関数、wdt_reset関数を使う。 #include <avr/wdt.h> void setup(){ wdt_enable(WDTO_2S); } void loop(){ do_something(); wdt_reset(); } ウォッチドッグタイマは計時が完了したら割り込み、リセット、または割り込み+リセットを発生させる。wdt_enable関数は計時完了時にリセットを発生させる様、ウォッチドッグタイマを設定する。しかしリセットを発生させず割り込みだけ発生させるようにす