Sainsmart 1.3 OLED I2C stays dark

Hi,

I'm having a problems getting this display to work.

I downloaded the library and uploaded the Hello World example using
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
Adress 0x3d

The display shows nothing.

using the ardafruit library in a new Sketch shows garbage but the display is online

If I'm loading the Hello World Example now, everything works fine until the Arduino has been shut down(Power OFF)

After Power ON (Hello World Sketch) the display is dark again ???

Any Suggestions ?

Thomas

Hi, welcome to the forum.

Can you give a link to that display ? This one ? [Discontinued] SainSmart 1.3" I2C IIC Serial 128X64 White OLED for Ard – SainSmart.com

Can you try the Software SPI ? u8g_dev_ssd1306_128x64_sw_spi
https://code.google.com/p/u8glib/wiki/device

Hi

U8glib expects the display at 0x3c.
If you see garbage on the screen with the adafruit lib, the display might have a SH1106 controller.

Oliver

Peter_n:
Can you give a link to that display ? This one ? [Discontinued] SainSmart 1.3" I2C IIC Serial 128X64 White OLED for Ard – SainSmart.com

Can you try the Software SPI ? u8g_dev_ssd1306_128x64_sw_spi
Google Code Archive - Long-term storage for Google Code Project Hosting.

Hi,

Displaytype is correct.

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

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

and
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

but im wasting memory

Thomas

Hi

There is a new adafruit constructor which has been added recently. I guess i forgot to document this:

U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(U8G_I2C_OPT_NONE);

Also you might need to connect the reset input of your display with 3.3V with U8glib

Oliver

olikraus:
Hi

There is a new adafruit constructor which has been added recently. I guess i forgot to document this:

U8GLIB_SSD1306_ADAFRUIT_128X64 u8g(U8G_I2C_OPT_NONE);

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.

Thomas

Hello,

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:

#define resetPin 4 // reset pin for OLED-Display

void setup( void ) {
Serial.begin( 9600 );
OLED_Reset();
u8g.begin();
}

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")

Udo

Hallo,

works PERFECT.

Thanks for Your help.

Tom

@Udo:

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?

Raimund