#include <SPI.h>
#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
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);

// 'wifi by Freepik', 40x40px
const unsigned char wifiIcon [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xaf, 0x47, 0xfe, 0x07, 0x60, 0xa3, 0x43, 0xee, 0x06, 0x20, 0xa3, 
	0x59, 0xae, 0xf4, 0x3b, 0xa9, 0x7d, 0xaa, 0xf5, 0x9b, 0xad, 0x7d, 0xaa, 0xf5, 0xdb, 0xad, 0x7d, 
	0x6a, 0xf3, 0xdb, 0xae, 0x7f, 0x6a, 0xeb, 0xdb, 0xae, 0x7e, 0x6a, 0x0b, 0xdb, 0xae, 0x7e, 0x6a, 
	0x0b, 0xdb, 0xaf, 0x7e, 0x7a, 0xeb, 0xdb, 0xaf, 0x7f, 0x7a, 0xeb, 0xdb, 0xaf, 0x7d, 0x7a, 0xf7, 
	0xdb, 0xaf, 0x7d, 0xba, 0xf5, 0xdb, 0xaf, 0x7d, 0xb6, 0xf5, 0xbb, 0xaf, 0x43, 0x86, 0x04, 0x3b, 
	0xaf, 0x43, 0xce, 0x06, 0x7b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x7b, 
	0xcf, 0x1f, 0xf7, 0xde, 0x3b, 0xc7, 0x1f, 0xf5, 0xfe, 0xf9, 0xd7, 0x7d, 0x75, 0xff, 0xf9, 0xdb, 
	0x7d, 0x7d, 0xaf, 0xfd, 0xdb, 0x1d, 0x7b, 0xaf, 0xfd, 0xdb, 0x1f, 0xbb, 0x8f, 0xf1, 0xdb, 0x7e, 
	0xbb, 0xae, 0xb7, 0xd7, 0x7e, 0xbb, 0xee, 0x36, 0xc7, 0x1e, 0xbb, 0xff, 0x7f, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x7f, 0x5f, 0xdd, 0x3b, 0xcf, 0xff, 
	0xcf, 0xff, 0xfb, 0xef, 0x67, 0xfe, 0xff, 0xb7
};

void setup() {
  Serial.begin(9600);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { 
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); 
  }
  
  // just intro
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(38,20);  display.println(F("ARDUCODING"));
  display.setCursor(39,35);  display.println(F("TEST ICON"));
  display.display(); //tampilkan data
  delay(3000); 
  display.clearDisplay(); //clear sebelum tampilan baru
  display.drawBitmap(44, 15, wifiIcon, 40, 40, WHITE); 
  display.display(); //tampilkan data
}

void loop() {
}