arduino examples

This commit is contained in:
2021-08-05 13:20:51 +09:00
commit 20c4a0fa7f
13 changed files with 663 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#include <avr/wdt.h>
void setup() {
wdt_disable(); // 셋업 중에는 워치독 사용을 중지한다.
Serial.begin(9600);
Serial.println("setup()");
wdt_enable(WDTO_4S);
}
void loop() {
wdt_reset(); // 워치독 타이머를 리셋한다.
//wdt_reset();
unsigned long currentMillis = millis();
Serial.println(currentMillis);
if (currentMillis>10000) {
while(1){
Serial.println("delay... ");
delay(1000);
}
}
Serial.println("loop()");
delay(1000);
}