128x64 monochrome OLED

Hi everyone.

I have managed to get hold of one of these from Seeedstudio: http://www.seeedstudio.com/depot/images/product/oledv1.jpg

The code has got simple functionality of drawing bitmaps or writing text.

I want to extend the library to be able to let's say draw a pixel at a particular x,y coordinate. Then draw lines and circles.

Has anyone done that before? I have been trying and struggling for a week now, to no avail!

Also, here is the datasheet: http://www.electrokit.se/download/SSD1308-2.pdf

Any help is much appreciated.

Thanks,
M.

Forbidden

You don't have permission to access /depot/images/product/oledv1.jpg on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
‹???????????????

maybe post a product link?

Here is the page where I got the datasheet from: http://www.electrokit.se/

And the product page: http://www.seeedstudio.com/depot/oled-frame-128x64-p-797.html?cPath=163_167

The links I sent work me though!

Thanks.

This is the first time I personally see this particular display is mentioned on the forum. Hope someone else has made a library for what you want. Maybe the KS0108 GLCD library can be ported to this display. That library has all the bells and whistles of graphical displays.

From what glanced at here:

http://seeedstudio.com/wiki/index.php?title=OLED_Frame

The display is not pin-compatible with KS0108 displays so don't use GLCD library.

Adafruit has a nice little library for similar displays: Monochrome 0.96 128x64 OLED Graphic Display - STEMMA QT : ID 326 : $17.50 : Adafruit Industries, Unique & fun DIY electronics and kits

Yep, found it just before you posted it.

Trying to use it, but whatever you try and do the Adafruit logo appears on the screen!

Any ideas?

M.

Trying to use it, but whatever you try and do the Adafruit logo appears on the screen!

A nice display. I did a look at the Adafruit library. To me it seems that you have to call "clear()" before you call "display()"

Oliver

Thank guys.

All sorted and working beautifully!

Regards,
M.

Pixel drawing seems to be very slow!

Does anyone know why?

Thanks.

Anyone??

Any ideas?

Thank you.

To clear out that logo simply zero out the predefined buffer array.

Just change the declaration of buffer to

static uint8_t buffer[1024];

And delete all the array data.
That will leave you with a blank screen.

As far as being slow, I'm assuming that you are referring to the adafruit code.
The code uses a frame buffer and when you call the display() function,
It re-draws the entire display by flushing out the entire frame buffer.
So if you set one pixel then call the display function, you just
wrote 8192 pixels to the display by sending 1024 bytes of data.
With that type of interface, you don't want to call the display function
until you have done many updates. i.e. don't call it for every pixel update,
wait to call it until you are fully done updating the screen.

It also uses the software SPI routines rather than use the SPI hardware.
While the software SPI allows using any pins, it will be much slower
than the hardware SPI especially since it uses digitalWrite() to control
all the pins.
The Arduino core library digital i/o routines including digitalWrite() have
lots of overhead to set the pin state vs direct port i/o. (like 40+ times slower)
And the hardware SPI is much faster at doing SPI than a direct port i/o
routine could ever be.

If you want better speed, look into using the SPI hardware but that
will require digging into their code to make the modifications since you
must then use the specific SPI pins vs any pins you want and use the SPI library.
--- bill

Thanks again for your reply.

The OLED display I use is an I2C version, I have just changed the SPI code from Adafruit to be able to use their code on my display.

Is I2C much slower than SPI and if so, then the speed I have is the fastest it goes I believe?

Thanks,
M.