Put Arduino Into Sleep Mode and Works for Weeks

It’s pretty useful when you have a arduino project run a long time when it is fully set up, now you can read about this on this post to get a fully explanation, will be pretty useful for sensor monitoring, wireless things, etc.

Get the JeeLib here. And use the following example code, sleepy function is replaced the delay(1000) function to get the arduino in sleep mode.

#include <JeeLib.h>  // Include library containing low power functions
int led = 13;
ISR(WDT_vect) { Sleepy::watchdogEvent(); } // Setup for low power waiting

void setup() {
  pinMode(led, OUTPUT);
}

void loop() {
  digitalWrite(led, HIGH);
  Sleepy::loseSomeTime(1000);      // Instead of delay(1000);
  digitalWrite(led, LOW);
  Sleepy::loseSomeTime(1000);      // Instead of delay(1000);
}

This post is refer to hardware startup blog, click here to see the original post.

Tagged

4 thoughts on “Put Arduino Into Sleep Mode and Works for Weeks

  1. hof

    Why did you steal an article straight off without even checking the contents of the article?

    Do you think this line of code will work?
    #include // Include library containing low power functions

    Reply
  2. Pingback: ATTiny84 mit Arduino Uno programmieren | 3bm.de

Leave a Reply

Your email address will not be published. Required fields are marked *