0

128x64 OLED Display Error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: 128x64 OLED Display Error

by Jack B on Thu Jan 21, 2016 9:57 am

I wen back and checked the library file and the 128x64 was commented out. Fixed that and now it's fine. I'm not sure how that got changed to 128x32 but that's what it was. Thanks
Jack B
 
Posts: 5
Joined: Sun Sep 16, 2012 11:41 am

Re: 128x64 OLED Display Error

by dhawr on Mon Mar 21, 2016 9:33 pm

Another solution ...

I have been using both the SSD1306 and SSD1305 displays successfully for many months. Recently I decided to move development to a new laptop running Windows 10. At first things looked normal because I was only working on the SSD1305 (1.5 inch 128x64 mono OLED). I was surprised however when I uploaded code to the project that used the SSD1306 ((1.3 inch 128x64 mono OLED). The graphics were stretched in the vertical dimension as if it only had x32 resolution vertically). It is actually writing a blank line in every other line (maybe even rows only?).

The interesting point here however is that if I upload exactly the same source code on my original development platform to that target device it works perfectly normally. So what is the difference?

The Arduino IDE version on the good machine was 1.6.5 and on the bad machine was 1.6.7. so that was suspect. However I discovered that the SSD 1306 library was also completely different. I took the library from the "bad machine" (1.1.0) and loaded it into the "good machine". Instantly bad results! So that implies that it is NOT the Arduino IDE that is causing the problem.
I took the 1306 library from the "good machine" (1.0.0) ! and loaded it onto the "bad machine" et voila! the "bad machine" is now a good machine.

I have now tested this on a third development system and can report the follows:

1) This is NOT an issue with the Arduino development environment. I can get this to work on different machines running different versions of the IDE and different OS too. So no reason to wait for the Arduino team.

2) This appears to be an issue with the Adafruit 1306 library. I have tested the three versions that I have for the library and the ONLY one that supports the 128x64 display appears to be 1.0.0.

3) It is problematic that only 1306 library 1.0.0 is the only good version because the Adafruit GFX library v1.1.4 and above (1.1.5 is the latest) does not work with 1306 v 1.0.0.

The good news however is that you can get the display to work well (looks great) using the following combination.
GFX versions 1.1.1, 1.1.2, 1.1.3 and the 1306 version 1.0.0. (If you use the library manager it is actually very easy to roll back to a previous version)

I can believe that the u8glib library works but since I have this working now I haven't given it a try.

Hopefully the above information is useful to the Adafruit team to look at what has gone astray. I haven't had a chance yet, but when I get the time I will see if I can find something.

dhawr
 
Posts: 19
Joined: Tue Feb 25, 2014 1:12 pm

Re: 128x64 OLED Display Error

by Jack B on Mon Mar 21, 2016 10:54 pm

I'm not sure but I think when the IDE updates the library it loads with the 32x128 resolution selected and the 64x128 is commented out. That is what happened on mine system. I had a similar problem and commenting out the 32 x 1 28 resolution in the libary fixed the issue.
Good Luck
Jack B
 
Posts: 5
Joined: Sun Sep 16, 2012 11:41 am

Re: 128x64 OLED Display Error

by dhawr on Tue Mar 22, 2016 5:18 pm

Thanks Jack, you are perfectly correct.

I reviewed the 1306 libraries and found that the default setting for the display size has changed from the original 1.0.0 version to the two later versions.

For those that don't know the file Adafruit_SSD1306.h sets the size of the display and if you are using the 128x64 size display it should read as below:
#define SSD1306_128_64
// #define SSD1306_128_32
// #define SSD1306_96_16

It does prove my assertion that this is not related to the Arduino version number but is instead an issue with the library. Fortunately it is a minor configuration issue that is easily changed.

David

dhawr
 
Posts: 19
Joined: Tue Feb 25, 2014 1:12 pm

Re: 128x64 OLED Display Error

by AyoSoul04 on Sun Jan 08, 2017 7:24 pm

Dear All,
Been having the same error as above (ssd1306_128_64_i2c:54: error: ("Height incorrect, please fix Adafruit_SSD1306.h!");

I traced it back to the header file (Adafruit_SSD1306.h) line number 74, where in my case #define SSD1306_128_32 was enabled. What I did was to comment out this line and reinstate line number 73 which was #define SSD1306_128_64. Save the fine and then verified the sketch. I was using ssd1306_128x64_i2c.
So depending on which sketch you are using there are four
(ssd1306_128x32_i2c, ssd1306_128x32_spi, ssd1306_128x64_i2c, ssd1306_128x64_spi), two spi's and two i2c you will need to configure the header file appropriately.

Hope this is the correct course of action and it helps.

AyoSoul04
 
Posts: 1
Joined: Sun Jan 08, 2017 7:11 pm

Re: 128x64 OLED Display Error

by franklin97355 on Mon Jan 09, 2017 12:05 am

Yes, that is the correct action.

franklin97355
 
Posts: 16280
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: 128x64 OLED Display Error

by agranum on Tue Jan 24, 2017 10:26 pm

I am also experiencing this issue with a 128x64 I2C display and it's driving me insane!

I am using IDE version 1.8.1 (even though this thread seems to have eliminated the IDE as an issue. And I would tend to agree)

My initial attempt was with the latest versions of Adafruit_GFX (1.1.5) and Adafruit_SSD1306 (1.1.2)
Like everyone else, this didn't display all 64 lines. Only 32. Odd values of y were not getting displayed.

I have this properly commented in Adafruit_SSD1306.h

#define SSD1306_128_64
// #define SSD1306_128_32
// #define SSD1306_96_16

I only have one copy of the libraries.

I have tried all of the following versions of Adafruit_GFX with version 1.0.0 of Adafruit_SSD1306 and they all behaved the same incorrect way.
(and I close and restart the IDE after each combination change to ensure the proper versions of the libraries are loading)
1.1.3
1.1.2
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0

I Serial.print out the value of SSD1306_LCDHEIGHT and it looks good (64)

What the heck is going on here!?!

I really hope I'm missing something simple. Otherwise I'm amazed anyone has gotten this to work on a 128x64

agranum
 
Posts: 1
Joined: Thu Jun 19, 2014 6:08 pm

Re: 128x64 OLED Display Error

by Ronfinlay on Sat Mar 18, 2017 3:17 pm

Great ideas. How do I find the version number you mentioned. I am brand new to this whole world of Arduino and totally lost. I have an adafruit UNO, MacBook running the latest OS. Small sketches work, neo pixel sticks and rings work (except I need to learn to code what I want, not the strand test). But this display is not doing anything. All connected right. But code from Adafruit's site won't compile. I can't find where it knows what size of display, but the code itself says it's for 128x64 monochrome OLED, which is exactly what I bought from Adafruit. I expected it all to work perfectly, since they seem to do such a great job with all their products. Thanks for any advice as I've been at this for days and not a dot of hope.

The program I'm trying to get to compile is the SSD1306... info
Attachments
Library Structure.png
Library Structure.png (56.69 KiB) Viewed 218 times

Ronfinlay
 
Posts: 31
Joined: Tue Jan 10, 2017 1:06 am

Re: 128x64 OLED Display Error

by Wile on Sun Jul 30, 2017 12:19 pm

Hello all,

I'm using a Yun.
I have a 128 64. It "kinda" works.

I have modified the Adafruit_SSD1306.h to have
Code: Select all | TOGGLE FULL SIZE
#define SSD1306_128_64
//   #define SSD1306_128_32


The coordinates when I draw something are right, but it only displays one line on two. On the attached image, the outer rectangle is (0,0,128,63). If I put (0,0,128,64), the last line is not displayed.

The diagonal line is (0,0,64,64). You can count the dots -> only 32.
Is there something do do for this ? What is wrong ?

My code (extract)

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
...
#define OLED_RESET 0
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.setTextWrap(false);
  display.clearDisplay();
  display.display();
}

void loop() {

  ...
  // Display for icons, text...
  ...
  display.drawRect(0, 0, 128, 63, WHITE);
  display.drawLine(0, 0, 64, 64, WHITE);
   
  display.display();

  delay(1000);
}


Tried GFX v1.1.3 and SSD1306 v1.0.0, but this does not change anything.

Tried on my WinVista and Win10, no change.

See attachment for the "bad ugly display" I get...
Attachments
IMG_20170730_170154_.jpg
LCD displays one line on two (only even ones ?)
IMG_20170730_170154_.jpg (910.3 KiB) Viewed 105 times

Wile
 
Posts: 2
Joined: Sun Jul 30, 2017 12:16 pm

Re: 128x64 OLED Display Error

by tomivm on Thu Aug 03, 2017 11:59 pm

The adrafruit library on oled lcd dont work good , can you help me!

tomivm
 
Posts: 2
Joined: Thu Aug 03, 2017 11:57 pm

Re: 128x64 OLED Display Error

by franklin97355 on Fri Aug 04, 2017 2:02 am

tomivm please start your own topic here and tell us what you are using, what code you are running, how you have things connected and what "dont work good" encompasses.

franklin97355
 
Posts: 16280
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: 128x64 OLED Display Error

by tomivm on Sat Aug 05, 2017 7:37 pm

Sorry, I can not find the button to create a post. Can you help me

tomivm
 
Posts: 2
Joined: Thu Aug 03, 2017 11:57 pm

Re: 128x64 OLED Display Error

by franklin97355 on Sat Aug 05, 2017 8:01 pm

It's here.
Attachments
2017-08-05_16h58_34.png
2017-08-05_16h58_34.png (20.43 KiB) Viewed 53 times

franklin97355
 
Posts: 16280
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: 128x64 OLED Display Error

by jgmsc1 on Wed Aug 09, 2017 2:02 pm

have an oled display that was fine until yesterday. now, this is the size (2x) I get, using these settings:
display.clearDisplay();
display.setTextSize(1);

display.setTextColor(WHITE);
display.setCursor(0,0);

don't understand what happened

thanks!
juan
Attachments
IMG_20170809_121941.jpg
IMG_20170809_121941.jpg (173.38 KiB) Viewed 24 times

jgmsc1
 
Posts: 2
Joined: Wed Aug 09, 2017 1:33 pm

Re: 128x64 OLED Display Error

by Wile on Wed Aug 09, 2017 3:32 pm

jgmsc1 What is you initialization code ?

Wile
 
Posts: 2
Joined: Sun Jul 30, 2017 12:16 pm

Please be positive and constructive with your questions and comments.