How is the syntax for u8g_dev_ssd1306_128x64_sw_spi?
What parameter do I need for (sck, mosi, cs, a0 [, reset])?
Display has only RST,SDA,SCL,GND,3,3V Connectors - Adress 0x3C
However,
with
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
the Display works perfect AFTER
Also you might need to connect the reset input of your display with 3.3V with U8glib
Oliver
Hallo,
RST at 3.3V - no success
U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(U8G_I2C_OPT_NONE); no - success
seems we have to wait for a Sainsmart library, until then i am using the Ardafruit librarys for init and U8GLIB for work in the same sketch - works fine.
I had the same problem with a dark display after following Power ON, and could bring it to work and reset correctly with this small code, without including a bunch of unnecessary libraries. Saved for me more than 8K of memory!
All you need is a free digital pin (i.e. digital 4), connect it with the Reset (RST) pin of the display and insert the code beyond in your project:
void OLED_Reset( void ) {
pinMode( resetPin, OUTPUT ); // Setup reset pin direction (used by both SPI and I2C)
digitalWrite( resetPin, HIGH );
delay( 1 ); // VDD (3.3V) goes high at start, lets just chill for a ms
digitalWrite( resetPin, LOW ); // bring reset low
delay( 10 ); // wait 10ms
digitalWrite( resetPin, HIGH ); // bring out of reset
}
hope it helps -works fine for my project!
(Arduino Nano and "SainSmart 1.3" I2C IIC Serial 128X64 Blue OLED for Arduino UNO MEGA2560")
thanks for the helpful advice; got same OLED display working with your additional code snippets.
One question: my display seems to swallow up the first column(s) and is adding vertical lines at the very end. Can I do something to get the display shift a few pixels to the right or is it a hardware device fault?