DS3231 RTC Module & 16x2 I2C LCD Display with ESP32 | Arduino IDE | English Subtitle

  Переглядів 1,099

DoIt.20

DoIt.20

7 місяців тому

If you need any custom code for your projects, please contact me on Skype- G B RANJITKAR (message only/no calls) Not free, there will be a fee.
DS3231 RTC Module & 16x2 I2C LCD Display with ESP32 | Arduino IDE | English Subtitle
Code : code is on the comment below.
Facebook : / doit20-104218935882053
Please Subscribe my Channel. Thank You!

КОМЕНТАРІ: 4
@doit.20
@doit.20 7 місяців тому
#include #include #include // Include the LiquidCrystal_I2C library RTC_DS3231 rtc; // Create an instance of the RTC_DS3231 class LiquidCrystal_I2C lcd(0x27, 16, 2); // Initialize the I2C LCD with its address (0x27 for most displays) and dimensions (16x2) void setup() { lcd.begin(); // Initialize the LCD lcd.backlight(); // Turn on the backlight (if available on your display) lcd.clear(); // Clear the LCD lcd.setCursor(0, 0); // Set the cursor to the top-left corner lcd.print("Initializing..."); Serial.begin(115200); Wire.begin(); if (!rtc.begin()) { Serial.println("Couldn't find RTC"); while (1); } // Uncomment the following lines to set the initial date and time if needed rtc.adjust(DateTime(__DATE__, __TIME__)); } void loop() { // Read the current date and time from the DS3231 DateTime now = rtc.now(); // Clear the LCD lcd.clear(); // Print the date and time on the LCD lcd.setCursor(0, 0); // Set the cursor to the top-left corner lcd.print("Date: "); lcd.print(now.year(), DEC); lcd.print("/"); printTwoDigits(now.month()); lcd.print("/"); printTwoDigits(now.day()); lcd.setCursor(0, 1); // Set the cursor to the second row lcd.print("Time: "); printTwoDigits(now.hour()); lcd.print(":"); printTwoDigits(now.minute()); lcd.print(":"); printTwoDigits(now.second()); lcd.print(" "); // Print the same information to Serial Serial.print("Current Date: "); Serial.print(now.year(), DEC); Serial.print("/"); printTwoDigits(now.month()); Serial.print("/"); printTwoDigits(now.day()); Serial.print(" Current Time: "); printTwoDigits(now.hour()); Serial.print(":"); printTwoDigits(now.minute()); Serial.print(":"); printTwoDigits(now.second()); Serial.println(); delay(1000); // Update every 1 second } void printTwoDigits(int number) { if (number < 10) { lcd.print("0"); // Print a leading zero for single-digit numbers } lcd.print(number); }
@fadhilmuh667
@fadhilmuh667 2 місяці тому
thanks for this
@muhammadridzkyf2103
@muhammadridzkyf2103 2 місяці тому
Hey can you help me? I have a problem when use RTC with LCD. We know that RTC and LCD use the same address I2C (0x27) addresses. So in my case, my esp32 have a panic error. Because the address of lcd and rtc is same. Do you know how to fix this error? I hope you read my comment 🙏🏻
@doit.20
@doit.20 2 місяці тому
Try different libruaris
Артем Пивоваров х Klavdia Petrivna - Барабан
03:16
Artem Pivovarov
Переглядів 8 млн
10 заповедей по пайке. Учимся паять
12:05
I make Water Turbine
22:03
King Homemade
Переглядів 10 тис.
12 Useful & Interesting ESP32 Projects for Beginners!
9:41
ToP Projects Compilation
Переглядів 569 тис.
Exploring the Arduino Nano ESP32 | MicroPython & IoT Cloud
57:43
DroneBot Workshop
Переглядів 160 тис.
A flexbox trick to improve text wrapping
5:02
Kevin Powell
Переглядів 87 тис.