/*
MSJ Researchers World
Date - 28th OCT 2024
Mentor - Mr. Siranjeevi M
Contact - 7373771991
*/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Define OLED display width and height in pixels
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
// Create an instance of the display
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup()
{
// Initialize OLED display
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C))
{ // 0x3C is the I2C address
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed if display initialization fails
}
display.clearDisplay(); // Clear the buffer
display.setTextSize(2); // Set text size to 2
display.setTextColor(SSD1306_WHITE); // Set text color to white
display.setCursor(0, 10); // Set cursor at (0,10)
display.print(F("Hello!")); // Print text to the buffer
display.display(); // Display the buffer on the screen
}
void loop()
{
// Nothing to do in loop
}