Go Down

Topic: Problem with SSD1306 LCD and U8glib (Read 14284 times) previous topic - next topic

saiko

Hi Oliver,

firstly thanks for this cool library.
I at last got mine up and running. I used both the 1.15 and 1.16 versions and I see this strange issue. The hello world shows up in 2 colours. top half yellow and bottom blue. Attaching the pic.

Also would you advice where I can learn to change the color to blue and yellow?

olikraus

You can not change the colors. This is a bi-color OLED. Actually a Monochrome OLED, but the top view rows have a different (fixed) color.
See for example here:
http://www.ebay.com/itm/Two-Color-0-96-inch-LED-128-64-High-resolution-OLED-Display-Module-/221120509913

Oliver

pazu


Worked perfectly! They're running very nicely together now :)

Thanks very much Oliver



Thanks, works perfect!  :)


Hi guys, would you mind post some of your code (or sample) on how you were changing/referencing the address in your normal run time loop? I'm able to address and talk to multiple displays one at a time (ie, change variable then compile in my main .ino file), but not dynamically within the same compile.

Cheers,
Matt

elecopper

I had trouble too and I think it came down to the order that I was addressing them within the program. Here's an example that works.
In the ug8_com_arduino_ssd_i2c.c
Code: [Select]

//#define I2C_SLA (0x7A)
uint8_t I2C_SLA = 0x7A;


This will write to the screens at startup and then swap what is written on each after 5 seconds:

Code: [Select]

#include "U8glib.h"

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);
extern uint8_t I2C_SLA;

boolean redraw_display_one = false;
boolean redraw_display_two = false;

void setup()
{
  I2C_SLA = 0x078;
  u8g.firstPage();
  do
  {
    draw_message_one();
  }
  while(u8g.nextPage());

  delay(10);

  I2C_SLA = 0x07A;
  u8g.firstPage();
  do
  {
    draw_message_two();
  }
  while(u8g.nextPage());
}

void loop()
{
  if (redraw_display_one)
  {
    I2C_SLA = 0x078;

    u8g.firstPage();
    do
    {
      draw_message_two();
    }
    while(u8g.nextPage());

    redraw_display_one = false;
  }

  if (redraw_display_two)
  {
    I2C_SLA = 0x07A;
    u8g.firstPage();
    do
    {
      draw_message_one();
    }
    while(u8g.nextPage());
    redraw_display_two = false;
  }
 
  unsigned long time = millis();
 
  if (time > 5000 && time < 5033)
  {
    redraw_display_one = true;
    redraw_display_two = true;
  }
}

void draw_message_one()
{
  u8g.setFont(u8g_font_fub20);
  u8g.drawStr(12, 28, "Hello");
  u8g.drawStr(12, 58, "World");
}

void draw_message_two()
{
  u8g.setFont(u8g_font_fub20);
  u8g.drawStr(12, 28, "Goodbye");
  u8g.drawStr(12, 58, "World");
}

pazu

Thank you thank you thank you!

Got it working, I had to change the third line to
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);

but other than that, worked a treat! Thanks!

nerobot

Thanks for the great work done on this device.

I've managed to get it working well on the Arduino using the examples which is working well.

However, is it possible to get the same release version for AVR as I can't see a way to make it work with the current version.

Many thanks.

Steven

olikraus

I have attached snapshots of the current repository for Arduino and AVR. Not tested, just development releases.

Oliver

nerobot

Hi Oliver,

Just a quick reply to say thanks for uploading the pre-release version.

After a few tweaks of the main c file, I was able to get each of the examples working well.

I'm now in the process of incorporating the libraries into my own project and it seems to be going well (though I need to try and figure out how to use the library more).

Thanks again, and if you'd like any testing done on the device, feel free to let me know. 

olikraus

I am glad to read, that the avr release works. For the final release, the avr version also undergoes some release testing.

Oliver

kurti

Hi Oliver,

the pre-release worked 'out of the box'.
I only had to add the constructor
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

and Bingo! there was the 'Hello World'.

Thanks for the great work.
Kurti
Zitat Jurs: falsche Verkabelung ist sowieso immer wenig förderlich für das Funktionieren der Hardware



hier könnte Ihre Werbung stehen

olikraus

Thanks for the feedback. Meanwhile also release 1.16 is officially available for download.

Oliver

SavPaff

Hi guys,

My name is Salvatore and I am from Germany. I first got a Adafruit 0.96" Monochrome OLED display and got it to work with the Adafruit OLED library over I2C. I found a 1.3" monochrome display on Ebay -> http://www.ebay.de/itm/261498239675?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2648 and didn't get it to work at all at first.

Using the u8glib_arduino_v1.16 I finally did it (almost).
Thank you Oliver for this great library!

The problem is, that the printed image/information is moved 2 pixels to the left. Changing the first pixel in the "Hello World" example only shifts the text but leaves the last 2 columns set randomly. (See attached picture)

Does anyone know a way I can fix this issue?

This is my first post (by the way).

Sal

olikraus

Hi Salvatore

Greetings from South Germany.

Your OLED does not contain the SSD1306 controller, but has the SH1106. In U8glib I added the SH1106 construcor with v1.16. This should fix your problem.

Recently, this has been asked more often here. I guess ebay sellers declare their OLEDs as SSD1306, but actually sell a display with SH1106 controller.

Oliver



unixbob

Interestingly, I've got what looks to be exactly the same OLED screen but it works with the adafruit ssd1306 libraries.

I used the ssd1306_128x64_i2c example and had to change the line

Code: [Select]
display.begin(SSD1306_SWITCHCAPVCC, 0x3D);

to

 
Code: [Select]
display.begin(SSD1306_SWITCHCAPVCC, 0x3c);

Attached a picture of the board below and it running the demo if anyone is interested





It also works with Oliver's patched U8glib library as well FWIW

Go Up