document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <virtuabotixRTC.h>
  2. virtuabotixRTC myRTC(6, 7, 8);
  3.  
  4. void setup() {
  5. Serial.begin(9600);
  6.  
  7. // Set the current date, and time in the following format:
  8. // seconds, minutes, hours, day of the week, day of the month, month, year
  9. myRTC.setDS1302Time(00, 59, 23, 6, 10, 1, 2014);
  10. }
  11.  
  12.  
  13. void loop() { //|
  14. // This allows for the update of variables for time or accessing the individual elements. //|
  15. myRTC.updateTime(); //|
  16. //|
  17. // Start printing elements as individuals //|
  18. Serial.print("Current Date / Time: "); //|
  19. Serial.print(myRTC.dayofmonth); //|
  20. Serial.print("/"); //|
  21. Serial.print(myRTC.month); //|
  22. Serial.print("/"); //|
  23. Serial.print(myRTC.year); //|
  24. Serial.print(" "); //|
  25. Serial.print(myRTC.hours); //|
  26. Serial.print(":"); //|
  27. Serial.print(myRTC.minutes); //|
  28. Serial.print(":"); //|
  29. Serial.println(myRTC.seconds); //|
  30. //|
  31. // Delay so the program doesn't print non-stop //|
  32. delay( 5000); //|
  33. }
');