AbstractBeliefs

Untitled

Dec 2nd, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Date and time functions using just software, based on millis() & timer
  2.  
  3. #include <Wire.h>
  4. #include "RTClib.h"
  5.  
  6. RTC_Millis RTC;
  7. int led = 3;
  8.  
  9. void setup () {
  10. Serial.begin(57600);
  11. // following line sets the RTC to the date & time this sketch was compiled
  12. RTC.begin(DateTime(__DATE__, __TIME__));
  13. pinMode(led, OUTPUT);
  14. }
  15.  
  16. void loop () {
  17. DateTime now = RTC.now();
  18.  
  19. if((now.hour() == 17) && (now.minute() == 1)){
  20. digitalWrite(led, HIGH);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment