Author Topic: Support for 128x32 OLED  (Read 6906 times)

torchris

  • Newbie
  • *
  • Posts: 17
Support for 128x32 OLED
« on: October 23, 2015, 06:59:11 pm »
Hello,

Is there any way to modify the existing DigisparkOLED library to support 128x32 i2c display rather than the 128x64 resolution? The display I am using is one of these SSD1306 units:

http://www.ebay.ca/itm/I2C-0-91-128x32-Monochrome-OLED-display-module-compatible-Arduino-/161173737381

What I am building needs to be small, so I don't have room for the 128x64 display. For other projects I have used the U8glib driver, but it is too big to work with the DigisparkPro.

All I want to do is display text and not graphics.

Thanks!!

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Support for 128x32 OLED
« Reply #1 on: October 23, 2015, 08:39:19 pm »
Using the same 1306 controller I recall there was a simple setting at the top to assist for the display area

torchris

  • Newbie
  • *
  • Posts: 17
Re: Support for 128x32 OLED
« Reply #2 on: October 24, 2015, 06:35:36 am »
That is what I am trying to find out. There is nothing obvious in the example file that I can see.

I have also checked the DigiSparkOLED.h and DigiSparkOLED.cpp without anything jumping out at me.


torchris

  • Newbie
  • *
  • Posts: 17
Re: Support for 128x32 OLED
« Reply #3 on: October 24, 2015, 05:15:18 pm »
Figured it out!! For anyone else who wants to use the smaller size OLED here is how to fix it:

In the file DigisparkOLED.cpp you need to change:

   0xA8, 0x3F,      // Set multiplex ratio(1 to 64)

to:

   0xA8, 0x1F,      // Set multiplex ratio(1 to 64)

and change:

   0xDA, 0x12,      // Set com pins hardware configuration   

to:

   0xDA, 0x02,      // Set com pins hardware configuration   

Seems to work fine. Of course, the included sample graphics will not display correctly, but the text comes up just fine. I will need to play a bit with the fonts to fix them.

regards,

Chris



defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Support for 128x32 OLED
« Reply #4 on: October 27, 2015, 02:21:30 pm »
Glad you found it.  I don't have that code on my machine so was going by memory.  And I may have been thinking of the original code I saw and ported it may have been that code having an up front IFDEF in it.