Electorials Electronics
Published © GPL3+

Review 006: 1.3" I2C White OLED Display Review

A review of the 1.3" I2C white OLED display from ICStation.

BeginnerProtip12 minutes1,133
Review 006: 1.3" I2C White OLED Display Review

Things used in this project

Hardware components

ICStation 1.3" i2c White OLED Display
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1

Story

Read more

Code

Arduino 1.3" I2C White OLED Display Sample Code

C/C++
#include "U8glib.h"
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE);	// I2C / TWI 

void draw(void) {
  u8g.setFont(u8g_font_unifont);
  u8g.drawStr( 0,10, "Hello World!");
}

void setup(void) {
  if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {
    u8g.setColorIndex(255);     // white
  }
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) {
    u8g.setColorIndex(3);         // max intensity
  }
  else if ( u8g.getMode() == U8G_MODE_BW ) {
    u8g.setColorIndex(1);         // pixel on
  }
  else if ( u8g.getMode() == U8G_MODE_HICOLOR ) {
    u8g.setHiColorByRGB(255,255,255);
  }
  pinMode(8, OUTPUT);
}

void loop(void) {
  u8g.firstPage();  
  do {
    draw();
  } while( u8g.nextPage() );
}

Credits

Electorials Electronics
85 projects • 66 followers
I'm an electronic hobbyist interested in anything, from Arduino to drones. I plan to educate people with the content on my website.
Contact

Comments

Please log in or sign up to comment.