0.96" SSD1306 128X64 OLED Display Module

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

0.96" SSD1306 128X64 OLED Display Module

Post by Alexinparis »

Hi,

Some weeks ago, I bought this display:
http://cgi.ebay.fr/0-96-128x64-OLED-Dis ... 0536921656

edit:
The one Howard ordered bellow is a much better choice because it works fine via I2C and not the previous one.
http://www.ebay.com/itm/130566448551?ss ... 177wt_1163


I managed to get it working using a SPI bus, but no success with I2C.
I think it would be very interesting to have such a display for multiwii as:
- it's cheap
- it's a fully graphical display
- it's very bright
- the resolution is very good
- it very light and small (we could fly with it with no weight impact, maybe a possibility to fix it next to a GPS on a BOB)
Last edited by Alexinparis on Sun Apr 22, 2012 4:48 pm, edited 1 time in total.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi Alex.

I ordered this one, a few days ago, with the same idea of leaving it on the copter. (waiting for it to arrive...)
http://www.ebay.com/itm/130566448551?ss ... 129wt_1163

It interfaces specifically on I2C at address 0x78 (8-Bit address) or 0x3C (7-bit address)

Micro OLED
Micro OLED
Last edited by howardhb on Mon Apr 23, 2012 11:32 am, edited 1 time in total.

User avatar
mbrak
Posts: 136
Joined: Sat Dec 03, 2011 8:08 pm
Location: Germany, Lemgo

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by mbrak »

wow!!!

thats very cool!!

perfect for display status messages or live display gps-data (coords and distance to target and....) flightmodes, lipo capacity

with a smal joystick or keypad module you could change settings on field.

many ideas... :)

+100

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by captaingeek »

skip the whole OSD thing and just have this screen mounted within view of your FPV cam

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

:mrgreen: Yes sir! That will work!

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

And, we already have I2C LCD (Eagletree powerpanel, #define LCD_ETPP) so hacking a solution for this display shouldn't be too difficult.
sample code for the I2C OLED dispaly is here: http://www.wide.hk/download/i2c_OLED.rar

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Well, this OLED display is small!
I photographed it next to a servo plug for size reference.
After much head-scratching...I got it to work! (Multiwii V 2.0!)
Thanks to the work done by Danal (Eagletree I2C LCD) and Th0rsten (LCD03), I was able to fudge it together....
I haven't yet completed the full implementation for Telemetry or config of AUX1 2 3 and 4.

It turns out that the display does not have a built in character ROM!
I had to create a 2 dimensioned array in ROM. Each character needs 8 bytes of data.
Had a to learn about using the variable modifier: PROGMEM to put the array in flash program memory on the ProMini !
Then, to access the array, use the macro "pgm_read_byte" to get the characters OUT of ROM.
The include file <avr/pgmspace.h> must be included, which already is, in MW V2.0!
All nicely explained here: http://www.nongnu.org/avr-libc/user-man ... space.html

128 by 64 pixels can be formatted into: 8 lines, with 16 characters on each line.

Howard.
Attachments
It's small!
It's small!
I2C OLED working!
I2C OLED working!
Last edited by howardhb on Tue Mar 27, 2012 1:41 pm, edited 1 time in total.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by nhadrian »

Wow, quite interresting project!!! Could be really useful on field!
Could you please tell me some words about cycle times and sketch size? Does sketch size or cycle time raise dramatically when using this display?
I'm thinking on buying one.....

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Wayne »

Nice work!
I ordered mine a week ago but not due here till mid April.
I hope to have it display MWs’ Home coordinates after FIX.
With this and a GPS phone, HOME location can be checked easily.
Again, good work Howard!

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by mr.rc-cam »

Awesome! I'd be interested in using it as a video cockpit in front of my FPV camera. How does its contrast look while outdoors in direct sunlight?

Is there any chance you could record an indoor demo video as it prints the text messages? It would be interesting to see if it has scanning artifacts like shown here:
http://www.youtube.com/watch?feature=pl ... OIvRt6WY4#!

At about the 10 sec mark you will see the image begin to go crazy. It's the camera shutter interacting with the scan rate of the OLED. The effect will change depending on the lighting conditions.

- Thomas

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Thanks guys!
I created # define OLED which then includes all the function primitives, same way LCD_ETPP and LCD_LCD_03 does it.

I have ITG3205, BMA180, BMP085 and HMC5883L
The cycle time is un-changed (flickers between 2700 - 3200)

With LCD_CONFIG and OLED defined, sketch size: 23496 bytes

Wihtout LCD_CONFIG sketch size: 20714 bytes

Can I share code here? (I don't yet know how to commit to a branch in Google code)

H.

User avatar
Th0rsten
Posts: 65
Joined: Mon Oct 31, 2011 10:28 am

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Th0rsten »

Yes, you can. :)

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

@mr.rc-cam:
I've uploaded a video to Utube: http://youtu.be/dm5RNufNArE
(excuse my phones video focus. ... It cant focus on something soo small !)
The video was taken inside, at 8.00am. (Sunshine outside)
I've solved a similar issue with FPV video (GoPro video output) which, in bright sunlight, produces a "jello" effect when the camera is mounted on something with, even small, vibrations.
The solution was to mount a ND 0.8 Filter (Neutral Density) in front of the camera's lens.
This "tricks" the camera into reducing its shutter speed, completely solving the "jello" effect.
A nice additional effect is, when flying fast forward, the sides of the video are slightly blurred, giving a visual feeling of seed.

@nhadrian:
I don't yet know what effect it will have on cycle-time, as , when the config is activated with THRO Low & YAW Right & Pitch Forward,
Wingui reports an error, no-comms.

Will post code this evening.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

Well done, Howard.

You might find the latest implementation of MULTILINE vs 2 LINES display for the configuration menu of interest. That could save you some work. It is currently hard-code to use 16lines x 34chars, but that could easily be changed. Not a real fullscreen config menu, but helps.

The code is in _shared in the google rep.

Cheers, Hamburger
Attachments
LCDconfig-multiline-s.jpg

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Thanks Hamburger!

Which BT slave module should I order to use your MULTILINE config and VT100 app for Blackberry?

I will investigate the effective use of the remaining 6 lines on the OLED display!
Maybe an 8 line, 2-page setup...(hack your MULTILINE :mrgreen: )

Cheers, Howard.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

howardhb wrote:Which BT slave module should I order to use your MULTILINE config and VT100 app for Blackberry?

BT range is effective 100m whith copter in air for class2 for me. Class1 modules claim 500m range, I have no experience with those yet.
I do no tiny soldering, so I buy BT module on shield (with 5V regulator and 2,54mm pins). You need a slave version. All brands I have come across allow to set serial speed and name - that is all you need. Lately I had good experience with these http://www.goodluckbuy.com/serial-bluet ... pin-1.html but take your pick at the usual spot markets.
For setup I started a compilation thread in this forum.
Which vt100 aware terminal program will you use on the blackberry?
I will investigate the effective use of the remaining 6 lines on the OLED display!
Maybe an 8 line, 2-page setup...(hack your MULTILINE :mrgreen: )

yes, please. In truth, the current implementation does not know about pages, it simply scrolls all config items as an endless revolving list. More to come.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

come to think of it - I just recharge my paypal and will order such an OLED for a small helicopter MWii flight controller.
Could you submit your code to the google rep? You may need to contact Alex for an account.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

I will post the function primitives here, in a ZIP attachment this evening.
Don't know how to submit to Google Code :oops:
Maybe you could add it to the repository for me?
H.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by mr.rc-cam »

@mr.rc-cam:
I've uploaded a video to Utube: http://youtu.be/dm5RNufNArE

Thank you, I appreciate that.

How's it look in bright outdoor lighting? Does it wash out or is the contrast still acceptable.

- Thomas

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

You're welcome, Thomas.
It's certainly readable in direct sunlight. I will try it with reversed colours (BLACK characters on WHITE back-round) tomorrow.

H.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Code for the OLED is in the attached ZIP.

Remember to #define OLED in config.h

and, in def.h

/**************************/
/* Error Checking Section */
/**************************/
#if (defined(LCD_CONF) || defined(LCD_TELEMETRY)) && !(defined(LCD_SERIAL3W) || defined(LCD_TEXTSTAR) || defined(LCD_VT100) || defined(LCD_ETPP) || defined(OLED)|| defined(LCD_LCD03))
#error "LCD_CONF or LCD_TELEMETRY defined, and choice of LCD not defined. Uncomment one of LCD_SERIAL3W or LCD_TEXTSTAR or LCD_VT100 or LCD_ETPP or LCD_LCD03"
#endif

and in Multiwii

setup()....
.
.
#elif defined(OLED)
initLCD();
#endif
.
.
Cheers, Howard.
Attachments
OLED_Functions_pde.zip
I2C OLED
(3.23 KiB) Downloaded 1164 times

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by mr.rc-cam »

It's certainly readable in direct sunlight. I will try it with reversed colours (BLACK characters on WHITE back-round) tomorrow.

Thank you, that would be very helpful. If it isn't too much trouble, please try recording the display with your camera again in bright light. The OLED's video artifacts will occur more aggressively with very fast shutter speeds (which requires bright ambient light). But if all this video recording stuff is too much of a nuisance then don't go out of your way to do it.

My goal is to put the OLED in front of my FPV camera. It will be used outdoors in bright sunlight. This sort of application needs a display that works well with the fast shutter on the FPV camera. That's the reason for all the weird questions. :)

- Thomas

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi Thomas.
I tried with the display reversed. Not good!
The resulting immage is a "white-out" because the "backround" is actually thousands of tiny LED's !
A internet search found the data sheet for the display driver chip, so I've discovered how to change the contrast.
(The "brightness" of the LED pixels can be varied)
Some experimentation is necessary.

I'll first need to add "contrast" to the LCD_CONFIG!

H.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

will integrate into _shared later today.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Before you do that... I made a few small changes and will post the revised functions here in a few minutes.
(1) The I2C low-level functions now set the speed to 400kHz, regardless of config settings.
(2) Added some comments to the command sequences for better understanding of the OLED driver instructions.
(3) Completely merged my code into MW V2.0 LCD.h.

H.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Revised LCD code attached. :)
Attachments
LCD.zip
OLED merged with V2.0 LCD.ino
(12.2 KiB) Downloaded 1008 times

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by mr.rc-cam »

howardhb wrote:Hi Thomas.
I tried with the display reversed. Not good!
The resulting immage is a "white-out" because the "backround" is actually thousands of tiny LED's !

Thanks for trying it out. But no worries; I expect the reverse video will increase the chance of video camera artifacts, so it is probably something I wouldn't use.

Thank you for posting the code!

- Thomas

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by nhadrian »

Thanks for the code!!! Really good job!!!!!
I have just ordered an OLED display, I hope I'll get soon!!!!!
I wish I could buy such parts from Europe.... then I could get them within few days.... :S:S:S

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Thanks Adrian!

I've just tested LCD_CONF_AUX_1234 definition, and it works fine.

Just for fun :o ,I made a LOGO, that is displayed at start-up....( a total waste of 1024 ROM bytes :twisted: )
I used a bitmatp to LCD BYTE converter......to generate the array.
I added a new function to display the array.

Logo.jpg

Also, I made a new font array, with 6 bytes (instead of 8) per character, so now we can put 21 characters on each line! (128 / 6 == 21)
To enable the 6 byte font,... add #define NEW_OLED_FONT to config.h
I've done this, because I'm going to try to implement Hamburger's MULTI-LINE config, split into 2 pages....

Attached is the revised LCD.ino


Cheers, Howard.
Attachments
LCD2.zip
(15.96 KiB) Downloaded 1037 times

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

Hi,
Small delay here.
About config menu: no need to split, just change screen length.
Current is 1+5+7 lines. 5 prior and 7 past current line.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi Hamburger.

I see you have functions for Inverse and Bold text in your Mutiline LCD functions...
To do that with the OLED, I would need to create 2 more dedicated ascii font tables....
I'll look into a work-around.....

H.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by nhadrian »

I can't wait till mine arrives!!! :(
Indeed, startup logo is only waste of bytes... but looks cool!
BTW, I'd use it without startup logo, maybe it sould be defined separatelly? I mean ie. when in config.h OLED_STARTUP_LOGO is defined then it is shown, without defined, not.
For me example, the root screen showed here in a previous post would be enough...

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

howardhb wrote:I see you have functions for Inverse and Bold text in your Mutiline LCD functions...
To do that with the OLED, I would need to create 2 more dedicated ascii font tables....
I'll look into a work-around.....


Ha, after some sleep, I found, inverse characters are simple to generate, without a new font array! :oops:
simply XOR 0b01111111 with each font byte that makes up the character!

........

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

howardhb wrote:I see you have functions for Inverse and Bold text in your Mutiline LCD functions...
To do that with the OLED, I would need to create 2 more dedicated ascii font tables....
I'll look into a work-around.....

howardhb wrote:
howardhb wrote:I see you have functions for Inverse and Bold text in your Mutiline LCD functions...
To do that with the OLED, I would need to create 2 more dedicated ascii font tables....
I'll look into a work-around.....

Ha, after some sleep, I found, inverse characters are simple to generate, without a new font array! :oops:
simply XOR 0b01111111 with each font byte that makes up the character!

Howard,
using XOR for inverting sure is a smart way to implement.
I also use 'bold' as an attribute.
Those two are attributes that the blueterm terminal program under android does support. ( the terminal program for my old palm treo does not!)
I am fully aware that not all programs / devices will implement all of these, so these are optional for the functionality. It will work and be usable without, always. Atm I use the font attributes in the multiline implementation to make the 'active' value easier to see. The basic thing is the active line is enclosed in '><' .
policy is: Attributes are nice to have but must in no way be mandatory for functionality nor usability.
I defninitely want to keep it that way.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi Hamburger.

The active line enclosed betwee > < is easy enough to implement in OLED.
I will keep to your Multi-line standard.
I thought about underlining the active characters but that would require some exta space between lines.
(Underline is not part of the character font)
This would reduce the number of screen lines to 7. That might be better, because this display is so small!
But, I'm not sure how to do it yet.

H.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

howardhb wrote:Just for fun :o ,I made a LOGO, that is displayed at start-up....( a total waste of 1024 ROM bytes :twisted: )
I used a bitmatp to LCD BYTE converter......to generate the array.
I added a new function to display the array.

Also, I made a new font array, with 6 bytes (instead of 8) per character, so now we can put 21 characters on each line! (128 / 6 == 21)
To enable the 6 byte font,... add #define NEW_OLED_FONT to config.h

what is the resolution in chars for the char sets? n lines x 21 rows?
Want to make the logo optional - always short on memory. Default could still be ON. See my SUPPRESS_bla for other options.
I would name it #define OLED_I2C_128x64. We might get support for other oleds in future. Ok?

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

I prefer more lines.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hamburger wrote:what is the resolution in chars for the char sets? n lines x 21 rows?

The chars are 6 bytes wide, the first 5 bytes are the font pattern, the 6th byte is always 0x00, which provides the space between chars.
The MSB of of each char data byte is always 0, which provides the inter line space of 1 pixel....

128 horizontal pixels, we can get 21 chars per line (128 / 6)
64 vertical pixels, we get 8 lines (64 / 8bits)

Font.png
font layout
(4.63 KiB) Not downloaded yet


Ok, I'll add #if defined OLED_I2C_128x64 to embrace the logo data array, and the logo printing functions, in my code.
I've also added a contrast setting function, which simply sets the contrast, or , "pulsates" the logo bright-dim-bright-dim.... looks cool!

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Hamburger »

Initial oled in mwii done.
Please use subversion to work on current code base in google repository

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by aamorin »

Hi everyone !

This is great! I was looking for some Multiwii LCD implementation to leave it on my hexa and this is the perfect solution!
I have a two questions about it, as I don't have a deep knowledge of multiwii, what do I have to do to enable/use it ? I mean, where should I connect it to (Flyduino mega board) and what do I have to uncomment in official MW 2.0 code?.. or I'm supposed to include some code by my own ?

Thanks a lot !
Cheers

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi @aamorin

The OLED is implemented in the shared subversion in google code.
You'll need to get:
LCD.pde http://multiwii.googlecode.com/svn/trun ... ed/LCD.pde
Multiwii.ino http://multiwii.googlecode.com/svn/trun ... ltiWii.ino
Config.pde http://multiwii.googlecode.com/svn/trun ... d/config.h

Replace the original MW V2.0 files with these. (copy and paste)
Then, in your replaced config, make sure the following is un-commented:
#define LCD_CONF
#define OLED_I2C_128x64

To edit / change the logo, as a starting point, use the LOGO bitmap in the attached zip file. Simply edit it with any paint program and save the bitmap as 8-bit, monochrome.
Then, you need to convert the bitmap to 1024 bytes of pixel data...
To do this, you'll need an executable called LCDassistant.exe. get it here: http://en.radzio.dxp.pl/bitmap_converter/
Run LCDassistant and load your modified LOGO.bmp
Make sure "Byte orientation" is set to Vertical and Pixels/byte is set to 8.
Then click Save Output. Name the file logo.h
Open this file with a text editor.
You should see the array variable definition : const unsigned char LOGO [] = {.......
You need all the data between the curly braces, so highlight all the bytes, and copy

Then, in LCD.pde look for
const uint8_t PROGMEM LOGO[] = { // logo....

Replace all 1024 bytes in the LOGO array with the array contents of file you've just saved. ( everything between "{" and "}" )
Do not change anything else.

H.
Attachments
LOGO.zip
OLED 128 x 64 logo.
(1.29 KiB) Downloaded 2428 times
Last edited by howardhb on Thu Dec 05, 2013 11:17 am, edited 1 time in total.

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by aamorin »

Wow, thanks a lot for all that clear information howardhb
I've only one more question...where to connect it to the Flyduino Mega ? (v2.1) as is i2c and not serial I don't know where to connect it, since it only has one i2c conector and is been used by the sensors..

Cheers,
aamorin

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by PatrikE »

Connect it in paralell with the sensors.

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Wayne »

Thank you Howard for all your hard work on this feature.
I did get my OLED yesterday, wired it up and tried to figure out how to get it to work

Today with a fresh copy of 2.0, I cut and paste your changes into it.
I made my config changes hit Verify and get, just like yesterdays attempt, ‘Buzzer was not declared..’.
Because I am using SpekSat I also found…. #define D8BUZZER…but this did not help.
Suppressing VBAT does not help.
I may have to wait for Alex to merge OLED into the main trunk.

I have not made changes to the logo yet but I did figure out, with your help, how to change the Logo.
Thank You!

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Wayne »

OK I got it!
Be sure to pickup the def.h file too.
After I suppressed all BUZZER stuff it works now!

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Doh! the one piece of information I didn't give provide..... where to connect it! :o

Mega.png

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Wayne »

This OLED thing is really cool.
I not only have a custom logo graphic, I have hacked TELEMETRY_PAGE_7 for my OLED.
On one screen I have GPS current, home and hold positions.
Problem is no matter what I do, all GPS_longitude_s are always scrambled characters.
OLED TEL PAGE 7.JPG

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Hi Wayne.

Glad your're finding it usefull! :lol:

Not sure if this is the issue, but it looks like you could use more characters per line on the OLED.
You have 16 characters at present.

Included in LCD.pde is a font that supports 21 characters per line. This is achieved by reducing the space between characters.
To activate 21 characters per line, in Config.h, uncomment //#define NEW_OLED_FONT

Give it a try....

H.

PS: check result each of the calculations for each digit of GPS_longitude.....
The character that gets printed (for each individual digit) is an "index" that is added to the character '0'.

Check these calculations in LCD.pde......
line2[9] = '0' + GPS_longitude / 1000000 - (GPS_longitude/10000000) * 10;
line2[10] = '0' + GPS_longitude / 100000 - (GPS_longitude/1000000) * 10;
line2[11] = '0' + GPS_longitude / 10000 - (GPS_longitude/100000) * 10;
line2[12] = '0' + GPS_longitude / 1000 - (GPS_longitude/10000) * 10;
line2[13] = '0' + GPS_longitude / 100 - (GPS_longitude/1000) * 10;
line2[14] = '0' + GPS_longitude / 10 - (GPS_longitude/100) * 10;
line2[15] = '0' + GPS_longitude - (GPS_longitude/10) * 10;

The under-lined portion of each calculation should evaluate to a integer, between 0 and 9.

Wayne
Posts: 86
Joined: Sun Jul 31, 2011 10:44 pm

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by Wayne »

I figured it out!
I am sure I have done it the hard way but I had to invert GPS_longitude.
Not bad for a guy who can’t code my way out of a paper bag.
Thanks Howard.
And Thank You PatrikE for getting me started.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: 0.96" SSD1306 128X64 OLED Display Module

Post by howardhb »

Awesome! :D

Post Reply