#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Define the screen dimensions and I2C address
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C // or 0x3C depending on your display
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup()
{
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS))
{
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
display.clearDisplay(); // Clear the display buffer
display.setTextColor(SSD1306_WHITE); // Set text color to white
display.setTextSize(1); // Set text size
display.setCursor(0,0); // Set cursor position
display.println(F("Hello, Class")); // Print text
display.display(); // Display the buffer
}
void loop()
{
// You can add more code here to update the display dynamically
}