copy the lib folder in the Arduino libraries
connect VCC / GND on the Arduino VCC / GND of the Arduino
Sign A4 Arduino -> SDA screen
Sign arduinon A5 -> SCL screen
hello world code for this screen:
#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g (U8G_I2C_OPT_NO_ACK);
void draw (void) {
// Graphic commands to redraw the full screen shoulds be Placed here
u8g.setFont (u8g_font_unifont);
//u8g.setFont(u8g_font_osb21);
u8g.drawStr (0, 22, "Hello World!");
}
void setup (void) {
// Flip screen, if required
// U8g.setRot180 ();
// Set SPI backup if required
//u8g.setHardwareBackup(u8g_backup_avr_spi);
// Assign default color value
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 is
}
else if (u8g.getMode () == U8G_MODE_HICOLOR) {
u8g.setHiColorByRGB (255,255,255);
}
}
void loop (void) {
// Loop picture
u8g.firstPage ();
do {
draw ();
} While (u8g.nextPage ());
// After rebuild the picture Some delay
delay (50);
}