#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define screen_width 128 // OLED DISPLAY WIDTH IN PIXELS
#define screen_height 64 // OLED DISPLAY HEIGHT IN PIXELS
#define oled_reset -1 // REST PIN
#define screen_address 0x3C // SEE DATA SHEET FOR ADDRESS
Adafruit_SSD1306 display(screen_width , screen_height ,&Wire , oled_reset);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC , screen_address)){
Serial.println(F("SSD1306 allocation failed "));
for(;;);
}
// turn on OLED DISPLAY
display.display();
delay(2000);
// clear OLED DISPLAY
display.clearDisplay();
//display a custom message
display.setTextSize (2);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.println(F("Welcome to Medibox!"));
display.display();
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}