DS3231 RTC Module & OLED Display 0.96" I2C 128x64 SSD1306 with Arduino | English Subtitle

  Рет қаралды 43

DoIt.20

DoIt.20

24 күн бұрын

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 & OLED Display 0.96" I2C 128x64 SSD1306 with Arduino | English Subtitle
Code : code is on the comment below.
Facebook : / doit20-104218935882053
Please Subscribe my Channel. ThankYou!

Пікірлер: 3
@doit.20
@doit.20 22 күн бұрын
#include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); RTC_DS3231 rtc; void setup() { Serial.begin(9600); // Initialize the OLED display if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x64 Serial.println(F("SSD1306 allocation failed")); for(;;); // Don't proceed, loop forever } // Initialize the DS3231 RTC if (!rtc.begin()) { Serial.println("Couldn't find RTC"); while (1); } if (rtc.lostPower()) { Serial.println("RTC lost power, let's set the time!"); // The following line sets the RTC to the date & time this sketch was compiled rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); // Uncomment the next line to set the date & time manually // rtc.adjust(DateTime(2024, 5, 25, 12, 0, 0)); } display.display(); delay(2000); // Pause for 2 seconds display.clearDisplay(); } void loop() { DateTime now = rtc.now(); // Clear the buffer display.clearDisplay(); display.setTextSize(2); // Larger text size display.setCursor(22, 0); display.print("DoIt.20"); // Display the current date display.setTextSize(1); // Larger text size display.setCursor(0, 25); display.print("Date: "); display.print(now.year(), DEC); display.print('/'); if (now.month() < 10) display.print('0'); display.print(now.month(), DEC); display.print('/'); if (now.day() < 10) display.print('0'); display.print(now.day(), DEC); // Display the current time display.setTextSize(2); // Larger text size display.setTextColor(SSD1306_WHITE); display.setCursor(0, 40); // display.print("Time: "); if (now.hour() < 10) display.print('0'); display.print(now.hour()); display.print(':'); if (now.minute() < 10) display.print('0'); display.print(now.minute()); display.print(':'); if (now.second() < 10) display.print('0'); display.print(now.second()); // Show the buffer on the display display.display(); // Wait for a second before updating delay(1000); }
@malikamanchanayake5006
@malikamanchanayake5006 7 күн бұрын
Works like a Charm.... Thanks a lot Bro
@prestononuselogu9973
@prestononuselogu9973 22 күн бұрын
Woah, thanks :)
OLED Displays with Arduino - I2C & SPI OLEDs
41:41
DroneBot Workshop
Рет қаралды 1 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 178 МЛН
TRY NOT TO LAUGH 😂
00:56
Feinxy
Рет қаралды 13 МЛН
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 129 М.
Flashing LEDs - Z80 Style
23:07
Julian Ilett
Рет қаралды 92 М.
#345 ESP32 vs STM32: Which one is better (Bluepill)?
15:37
Andreas Spiess
Рет қаралды 234 М.
How to use DS3231 RTC module to build OLED clock
15:34
Mario's Ideas
Рет қаралды 30 М.
How I make my A320 KORRY Buttons
23:47
Santi Luib III - SL3 Simulations
Рет қаралды 32 М.
Make a TINY Arduino Drone with FPV Camera - Will It Fly?
20:26
Max Imagination
Рет қаралды 522 М.