The code doesn't match with the video. I asked chatGPT to write a code for setting up the reat time clock with the same pins as the pins this video used. Just change some codes like Serial.print to lcd.print. #include #include // Define the pin numbers #define PIN_ENA 8 #define PIN_CLK 6 #define PIN_DAT 7 // DS1302 RTC instance Ds1302 rtc(PIN_ENA, PIN_CLK, PIN_DAT); void setup() { Serial.begin(9600); // Initialize the RTC rtc.init(); // Test if clock is halted and set a date-time to start it if (rtc.isHalted()) { Serial.println("RTC is halted. Setting time..."); Ds1302::DateTime dt = { .year = 24, // Set the year to 2024 .month = Ds1302::MONTH_MAY, // Set the month to May .day = 19, // Set the day to 19 .hour = 21, // Set the hour to 21 .minute = 9, // Set the minute to 9 .second = 41, // Set the second to 41 .dow = Ds1302::DOW_SUN // Set the day of the week to Sunday }; rtc.setDateTime(&dt); } } void loop() { // Get the current time Ds1302::DateTime now; rtc.getDateTime(&now); static uint8_t last_second = 0; if (last_second != now.second) { last_second = now.second; // Print the date and time in the format "YYYY/MM/DD HH:MM:SS" Serial.print("20"); Serial.print(now.year); // 00-99 Serial.print('/'); if (now.month < 10) Serial.print('0'); Serial.print(now.month); // 01-12 Serial.print('/'); if (now.day < 10) Serial.print('0'); Serial.print(now.day); // 01-31 Serial.print(' '); if (now.hour < 10) Serial.print('0'); Serial.print(now.hour); // 00-23 Serial.print(':'); if (now.minute < 10) Serial.print('0'); Serial.print(now.minute); // 00-59 Serial.print(':'); if (now.second < 10) Serial.print('0'); Serial.println(now.second); // 00-59 } delay(100); }
Thank you so much for your video. The analog pins that were used for the LCD, are it not possible to use them again for another module? Because I need more analog pins for my moisture modules.
In the video you said the DS1302 would take the time and date from the computer but my clock sometimes says "Enter year" and sometimes "Date: 165/165/21" "Time 37:65:85" + in the .zip that you put there's a picture called "keypad-circuit.jpg" and the code has the keypad library
Dear Friend: First of all, thank you very much for sharing your knowledge. Please, would there be a possibility of facilitating the program of said project? Waiting for your news, receive a cordial greeting from the Canary Islands (Spain)......
clickbait
The code doesn't match with the video.
I asked chatGPT to write a code for setting up the reat time clock with the same pins as the pins this video used. Just change some codes like Serial.print to lcd.print.
#include
#include
// Define the pin numbers
#define PIN_ENA 8
#define PIN_CLK 6
#define PIN_DAT 7
// DS1302 RTC instance
Ds1302 rtc(PIN_ENA, PIN_CLK, PIN_DAT);
void setup()
{
Serial.begin(9600);
// Initialize the RTC
rtc.init();
// Test if clock is halted and set a date-time to start it
if (rtc.isHalted())
{
Serial.println("RTC is halted. Setting time...");
Ds1302::DateTime dt = {
.year = 24, // Set the year to 2024
.month = Ds1302::MONTH_MAY, // Set the month to May
.day = 19, // Set the day to 19
.hour = 21, // Set the hour to 21
.minute = 9, // Set the minute to 9
.second = 41, // Set the second to 41
.dow = Ds1302::DOW_SUN // Set the day of the week to Sunday
};
rtc.setDateTime(&dt);
}
}
void loop()
{
// Get the current time
Ds1302::DateTime now;
rtc.getDateTime(&now);
static uint8_t last_second = 0;
if (last_second != now.second)
{
last_second = now.second;
// Print the date and time in the format "YYYY/MM/DD HH:MM:SS"
Serial.print("20");
Serial.print(now.year); // 00-99
Serial.print('/');
if (now.month < 10) Serial.print('0');
Serial.print(now.month); // 01-12
Serial.print('/');
if (now.day < 10) Serial.print('0');
Serial.print(now.day); // 01-31
Serial.print(' ');
if (now.hour < 10) Serial.print('0');
Serial.print(now.hour); // 00-23
Serial.print(':');
if (now.minute < 10) Serial.print('0');
Serial.print(now.minute); // 00-59
Serial.print(':');
if (now.second < 10) Serial.print('0');
Serial.println(now.second); // 00-59
}
delay(100);
}
Thank you so much for your video. The analog pins that were used for the LCD, are it not possible to use them again for another module? Because I need more analog pins for my moisture modules.
I appreciate your help bro you explained so perfectly I wish I can subscribe as many times as I feel 🙏👍👍👍👍
Are you the actual dhar mann
my first time seeing "Dhar Mann" in my favorite video of arduino
HOW MUCH IS A DS1302 RTC COST IN SRI LANKA
You can change the date & time?
Bro please send this cose
Bro please this code for 2024
you can do it with a 7 segment display PLEASE
why doesnt it show the keypad library? am i supposed to delete that one?
why your codes are the same in your project files?
gracias boliviano :D
thankyou very much sir you save us from our prelim examination
In the video you said the DS1302 would take the time and date from the computer but my clock sometimes says "Enter year" and sometimes "Date: 165/165/21" "Time 37:65:85" + in the .zip that you put there's a picture called "keypad-circuit.jpg" and the code has the keypad library
This happens when RTC module partially connected
have the same problem, have you fixed it?
How to introduce alarmes plz?
Bro please sent this audino code
You’re welcome if I’m not to late
1307. Use. Honga ki nahi. 1302 se.
PIN 1 》GROUND
PIN 2 》POSITIVE
PIN 3 》10K POT
PIN 4 》A12
PIN 5 》GROUND
PIN 6 》A11
PIN 11 》A5
PIN 12 》A4
PIN 13 》A3
PIN 14 》A2
PIN 15 》220Ω
PIN 16 》GROUND
Thanks
Please, how do you include multiple alarms?
which library?
the code says it uploaded but nothing changes on the lcd, any ideas? I am sure the com is right
Try to rotate the potentiometer
what potenciometer
@@EnjoyMechatronics
can you simulate proteus , please
How do I get a Parts list??
Can you share your codes, please?
● Project Files: github.com/Enjoy-Mechatronics/Arduino-RTC
bro it said here
can't open sketch main file missing from sketch
Yeah boiiiii
Really good tutorial, thanks
Glad it was helpful!
sir can I ask why my time and date is wrong
muchas gracias, esta super bien explicado, lo entendi hasta yo que casi no entiendo el idioma, que gran contenido.
thank youuuuuu❤
No worries 👍
i used two time module...why my 1st module displays only the 0/0/2000 0:0:0 and the other module is 165/165/2165 and 37:165:85
Check out this video in which we've added a Keypad to set the date and time manually
ruclips.net/video/c40S3z0OcuE/видео.html
I had this problem too (0/0/2000 0:0:0).
You need to check the wiring pin (7, 6, 8); // DAT, CLK, RST
Dear Friend: First of all, thank you very much for sharing your knowledge. Please, would there be a possibility of facilitating the program of said project? Waiting for your news, receive a cordial greeting from the Canary Islands (Spain)......
Thanks for your comment
I've create a more updated version of this project
ruclips.net/video/c40S3z0OcuE/видео.html
I can’t see my time, help me pls?
I can't either
RtcDateTime currenTime = RtcDateTime(_DATE_ , _TIME_);
Rtc.SetDateTime(currentTime);
this is an error for me pls help :(
RtcDateTime currentTime = RtcDateTime(__DATE__, __TIME__);
Rtc.SetDateTime(currentTime);
make sure same spelling....Yours is currenTime & currentTime there
My code is not working
Skill issue mate
@@zeusolympus1664 🗿
Sir, what is the time format, is it in the military time?
WOW THIS WAS THE ONLY VIDEO WHICH EXPLAINED EVERYTHING **PERFECTLY** SO UNDERATED
Thanks 😊
Is
Can u pls send code
github.com/Enjoy-Mechatronics/Arduino-RTC
but there is some matrix keypad
@@EnjoyMechatronics
okay