Advertisement
RuiViana

Untitled

Jun 8th, 2015
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1.  
  2. #include <Wire.h>
  3. #include "RTClib.h"
  4.  
  5. RTC_DS1307 rtc;
  6. char Teste;
  7.  
  8. //--------------------------------------------------
  9. void setup () {
  10. Serial.begin(57600);
  11. Wire.begin();
  12. rtc.begin();
  13. if (! rtc.isrunning())
  14. {
  15. Serial.println("RTC is NOT running!");
  16. rtc.adjust(DateTime(2015,6,8,19,11,55));
  17. }
  18. }
  19. //--------------------------------------------------
  20. void loop ()
  21. {
  22. DateTime now = rtc.now();
  23.  
  24. Serial.print(now.year(), DEC);
  25. Teste = (now.year(), DEC);
  26.  
  27. delay(3000);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement