#include <Arduino.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
// The pins for I2C are defined by the Wire-library.
#define SCREEN_ADDRESS \
0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
uint32_t count{};
void setup() {
display.begin(SSD1306_SWITCHCAPVCC,SCREEN_ADDRESS);
display.display();
delay(2000);
display.setTextSize(1);
display.cp437(true);
Serial.begin(9600);
}
void loop() {
display.clearDisplay();
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.printf("%s","Hello Wolrd!\n");
display.display();
Serial.println(count++);
delay(2000);
}