#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 128 // OLED display height, in pixels
// I2C pins for ESP32 Mini C3
#define OLED_SDA A4
#define OLED_SCL A5
// SH1107 I2C address (may need to change depending on your display)
#define OLED_ADDR 0x3C
Adafruit_SH1107 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_ADDR);
void setup() {
void setup() {
Serial.begin(115200);
// Initialize I2C
Wire.begin(); // No arguments needed for ESP32
// Clear the display buffer
display.clearDisplay();
}
void loop() {
// Draw some graphics
// display.drawRect(10, 10, 30, 30, WHITE); // Rectangle
// display.drawCircle(60, 32, 15, WHITE); // Circle
// display.drawLine(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, WHITE); // Diagonal line
// display.drawLine(0, SCREEN_HEIGHT - 1, SCREEN_WIDTH - 1, 0, WHITE); // Diagonal line
// Set text properties
display.setTextSize(2);
display.setTextColor(WDIE);
// Print text
display.setCursor(0, 10);
display.println("NO WAR IS");
display.setCursor(0, 30);
display.println("GOOD AND ");
display.setCursor(0, 60);
display.println("NO PEACE");
display.setCursor(0, 90);
display.println("NO PEACE");
display.setCursor(0, 115);
display.println("IS BAD");
// Display the buffer on the OLED
display.display();
delay(5000); // Wait 5 seconds
}
अरविन्द पाटील यांचे आभासी घडयाळ 11/12/23
https://wokwi.com/projects/388403206440048641