Pages: 1 2 3 [4] 5   Go Down
Author Topic: Problem with SSD1306 LCD and U8glib  (Read 9675 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


* WP_001697.jpg (381.45 KB, 1222x1630 - viewed 95 times.)
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Worked perfectly! They're running very nicely together now smiley

Thanks very much Oliver

Thanks, works perfect!  smiley

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
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
//#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:
#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");
}
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Oliver

* u8glib_arduino_v1.16pre3.zip (1081.72 KB - downloaded 40 times.)
* u8glib_avr_v1.16pre3.zip (1037.88 KB - downloaded 18 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Oliver
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 222
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Zitat Jurs: falsche Verkabelung ist sowieso immer wenig förderlich für das Funktionieren der Hardware

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Oliver
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* Foto.JPG (664.08 KB, 1632x1224 - viewed 57 times.)
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1551
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That was it!

Thank you so much!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
display.begin(SSD1306_SWITCHCAPVCC, 0x3D);

to

 
Code:
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
Logged

Pages: 1 2 3 [4] 5   Go Up
Jump to: