olikraus / u8glib

Arduino Monochrom Graphics Library for LCDs and OLEDs
https://github.com/olikraus/u8glib/wiki
Other
1.25k stars 315 forks source link

Confirmed working init string SSD1305 128x32 I2C #285

Open olikraus opened 9 years ago

olikraus commented 9 years ago

Originally reported on Google Code with ID 286

For future implementation, this modified file will successfully work with the SSD1305
and I2C.

Verified with Arduino Uno and 4.7k pullup resistors.

http://www.buydisplay.com/default/2-2-inch-128x32-oled-dot-matrix-display-module-with-pcb-blue-on-black

I realize that modifying this particular file was probably not the proper solution,
please forgive me for being a bit of a noob.

Hope this helps.

Reported by shane@xnote.com on 2014-09-28 01:02:38


olikraus commented 9 years ago
thanks, i will have a look at it.

Reported by olikraus on 2014-09-28 04:41:35

olikraus commented 9 years ago
Maybe i should buy such kind of displays with a SSD1305 controller.

For example:
http://www.buydisplay.com/default/2-4-inch-oled-module-128x64-graphic-display-price-arduino-green-on-black

Reported by olikraus on 2014-12-13 17:17:26

olikraus commented 9 years ago
I have also since added the contrast functionality on to this driver.  It works great!
 I did remove the (>> 1) to allow for full 0-255 range.  What was the reasoning behind
this being there?

Technically there is a "brightness" setting in the SSD1305 as well, but I have only
had luck with adjustments to that during the first initialization, it doesn't seem
to work well during operation.  I don't know why.

If you would like a patch, or files, let me know, I can send them.  Also, although
the original init string I sent works great, I have made some more changes since.

Reported by shane@xnote.com on 2014-12-13 23:56:00

olikraus commented 9 years ago
I wanted the contrast function to be identical throughout all controllers. So the user
contrast value is always from 0 .. 255. Maybe the SSD1306 only has 7 bit for the contrast.

It you could add the latest version of your modified c files, this would be nice.

Thanks!

Reported by olikraus on 2014-12-14 08:20:42

olikraus commented 9 years ago
The SSD1306 did not have contrast control enabled, although it appears that chip supports
contrast. (Maybe this should be added!?)  I stole the contrast code from the SSD1325
files, removed the (>> 1), and added it to the SSD1305 file I have created.  It works
great!

There are a few other changes inside this file as well, but one line of importance
is 202.  The SSD1305 native resolution is 132x32, and the line 202 change was necessary
for proper operation on a 128x32 display.

I am using this code very successful on a Raspberry Pi, with porting help from a good
friend who has also been posting on issue 171.

Reported by shane@xnote.com on 2014-12-14 09:19:22


olikraus commented 9 years ago
Thanks for the contribution.
I probably need to buy such a display for proper testing first.

Reported by olikraus on 2014-12-14 10:21:51