Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LINE/twitter: @bambangSud #Whatsapp +62811234123
- #include <stdint.h>
- #include <avr/interrupt.h>
- #include <avr/wdt.h>
- #define LED_PIN 13
- /*
- * The setup function.
- */
- void setup() {
- Serial.begin(9600);
- pinMode(LED_PIN, OUTPUT);
- wdtSetup(); // <<--------- sub routine nya ada di bawah
- }
- /*
- * The main loop.
- */
- void loop()
- {
- digitalWrite(13, HIGH); // set the LED on
- delay(1000); // wait for a second
- digitalWrite(13, LOW); // set the LED off
- delay(1000); // wait for a second
- Serial.println("Background");
- }
- /*
- * Setup of the watchdog timer.
- */
- void wdtSetup() {
- cli();
- MCUSR = 0;
- WDTCSR |= B00011000;
- WDTCSR = B01000111;
- sei();
- }
Add Comment
Please, Sign In to add comment