Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Code formatting.
Source Link
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11 
//And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); }``` 
//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

//And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); }``` 
17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11 
//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 
deleted 152 characters in body
Source Link

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

17:15:21.835//And ->you Currentcan Datevisualize /them Time:on 26the serial monitor /2/2023This 17:15:44code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information   #include <virtuabotixRTC.h> //Library used   //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the 17:15:26.830pins ->here Currentalso  Date void /setup() Time:{  26Serial.begin(9600); /2/2023 17:16:13 Set the current date, and time in the following format:  // seconds, minutes, hours, day of the week, day of the month, month, year  myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above    //but remember to "comment/remove" this function once you're done 17:15:31.856 ->//The Currentsetup Dateis /done Time:only 26/2/2023one 17:16:42time and the module will continue counting it automatically }   void loop() {  // This allows for the update of variables for time or accessing the individual elements.  myRTC.updateTime();   // Start printing elements as individuals  Serial.print("Current Date / Time: ");  Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system  Serial.print("/");  Serial.print(myRTC.month);  Serial.print("/");  Serial.print(myRTC.year); 17:15:36 Serial.853print(" ->");  CurrentSerial.print(myRTC.hours);  DateSerial.print(":");  /Serial.print(myRTC.minutes);  TimeSerial.print(":");  26Serial.println(myRTC.seconds); /2/2023 17:17:11Delay so the program doesn't print non-stop delay(5000); }``` 

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 
17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11 

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information   #include <virtuabotixRTC.h> //Library used   //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also   void setup() {  Serial.begin(9600); // Set the current date, and time in the following format:  // seconds, minutes, hours, day of the week, day of the month, month, year  myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above    //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically }   void loop() {  // This allows for the update of variables for time or accessing the individual elements.  myRTC.updateTime();   // Start printing elements as individuals  Serial.print("Current Date / Time: ");  Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system  Serial.print("/");  Serial.print(myRTC.month);  Serial.print("/");  Serial.print(myRTC.year);  Serial.print(" ");  Serial.print(myRTC.hours);  Serial.print(":");  Serial.print(myRTC.minutes);  Serial.print(":");  Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); }``` 
formatted code
Source Link
jsotola
  • 1.6k
  • 2
  • 13
  • 22

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//And you can17:15:21.835 visualize-> themCurrent onDate the/ serialTime: monitor 26/2/This2023 code17:15:44 is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information   #include <virtuabotixRTC.h> //Library used   //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins17:15:26.830 here-> also Current  voidDate setup()/ { Time: Serial.begin(9600); 26/2/2023 Set17:16:13 the current date, and time in the following format:  // seconds, minutes, hours, day of the week, day of the month, month, year  myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above    //but remember to "comment/remove" this function once you're done  //The setup 17:15:31.856 is-> doneCurrent onlyDate one/ timeTime: and26/2/2023 the17:16:42 module will continue counting it automatically }   void loop() {  // This allows for the update of variables for time or accessing the individual elements.  myRTC.updateTime();   // Start printing elements as individuals  Serial.print("Current Date / Time: ");  Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system  Serial.print("/");  Serial.print(myRTC.month);  Serial.print("/");  Serial.print(myRTC.year);  Serial17:15:36.print("853 "); -> Serial.print(myRTC.hours); Current Serial.print(":"); Date Serial.print(myRTC.minutes); / Serial.print("Time:");  Serial.println(myRTC.seconds); 26/2/ Delay so the program doesn't print non-stop 2023 delay(5000); }```17:17:11 

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 

17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13 17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information   #include <virtuabotixRTC.h> //Library used   //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also   void setup() {  Serial.begin(9600); // Set the current date, and time in the following format:  // seconds, minutes, hours, day of the week, day of the month, month, year  myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above    //but remember to "comment/remove" this function once you're done  //The setup is done only one time and the module will continue counting it automatically }   void loop() {  // This allows for the update of variables for time or accessing the individual elements.  myRTC.updateTime();   // Start printing elements as individuals  Serial.print("Current Date / Time: ");  Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system  Serial.print("/");  Serial.print(myRTC.month);  Serial.print("/");  Serial.print(myRTC.year);  Serial.print(" ");  Serial.print(myRTC.hours);  Serial.print(":");  Serial.print(myRTC.minutes);  Serial.print(":");  Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop  delay(5000); }``` 
17:15:21.835 -> Current Date / Time: 26/2/2023 17:15:44 17:15:26.830 -> Current Date / Time: 26/2/2023 17:16:13  17:15:31.856 -> Current Date / Time: 26/2/2023 17:16:42 17:15:36.853 -> Current Date / Time: 26/2/2023 17:17:11 

As you can see from the above output, the DS1302 is running five times faster than the real time (output past 30 seconds as real word past 5 seconds). Same thing happened if use different codes with different libraries.

Does this mean the RTC module itself is broken, or I can modify RTC module's speed with code?

//This code is to use with DS1302 RTC module, it permits you to setup the actual time and date //And you can visualize them on the serial monitor //This code is a modified version of the code provided in virtuabotixRTC library //Refer to https://Surtrtech.com for more information #include <virtuabotixRTC.h> //Library used //Wiring SCLK -> 6, I/O -> 7, CE -> 8 //Or CLK -> 6 , DAT -> 7, Reset -> 8 virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(15, 15, 17, 7, 26, 2, 2023); //Here you write your actual time/date as shown above //but remember to "comment/remove" this function once you're done //The setup is done only one time and the module will continue counting it automatically } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay(5000); } 
Source Link
Loading