#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 //OLEDcdisaplay width , in pixels
#define SCREEN_HEIGHT 64 // OLED dispaly height , in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C /// < See datasheet for address ; 0x3D for 128x64 , 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup(){
Serial.begin(9600);
//put the setup code here to run once:
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)){
Serial.println(F("SSD1306 allocation faild"));
for(;;);//Don't procced , loop forever
}
//show initial display buffer contents on the screen---
//the library initializes this with an Adafruit splash screen
display.display();
delay(2000); // pause for 2 seconds
//clear the buffer
display.clearDisplay();
display.setTextSize(1); // Noraml 1:1 pixel scale
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.println(F("Welcome to Medibox!"));
display.display();
//delay(3000);
//display.clearDisplay();
//display.setTextSize(2); // Noraml 1:1 pixel scale
//display.setTextColor(SSD1306_WHITE);
//display.setCursor(0,0);
//display.println(F("Love you rebecca!"));
//display.display();
}
void loop() {
delay(10);
//delay(10); // this speeds up the simulation
}