#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREENWIDTH 128 //OLED display width in pixels
#define SCRRENHEIGHT 64 //OLED display height in pixels
#define OLEDRESET -1 //Reset pin
#define SCRRENADDRESS 0x3C /// < see data sheet for address
Adafruit_SSD1306 display(SCREENWIDTH,SCRRENHEIGHT, &Wire, OLEDRESET );
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if(!display.begin(SSD1306_SWITCHCAPVCC, SCRRENADDRESS )){
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
// show initial display buffer contents on the screen
// the library initializes this with an Adafruit splash scrren.
display.display();
delay(2000);
//clear the buffer
display.clearDisplay();
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.println(F("Welcome to kavindya!"));
display.display();
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}