#include <U8glib.h>
U8GLIB_SH1106_128X64 oled(U8G_I2C_OPT_NONE); // I2C
void setup() {
// put your setup code here, to run once:
// Flip screen, if required:
// oled.setRot180();
// assign default color value:
oled.setColorIndex(1);
// 1 means draw by turning pixels on.
// 0 would be drawing by turning pixels off.
}
void loop () {
// put your main code here, to run repeatedly:
// Picture loop:
oled.firstPage(); // starts the picture loop
do {
draw();
} while ( oled.nextPage() ); // stop when nextPage returns zero.
}
void draw(void) {
// graphic commands to redraw the complete screen should be placed here:
oled.setFont(u8g_font_unifont);
oled.drawStr(0, 22, "Coding is cool!");
// 0: far left position in x,
// 22: 22 pixels down from upper left-hand corner.
// Whatever you want to draw (text, dots, lines, shapes, etc.) put here in this function.
}