📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Attention all domestic customers! Please place UPS Ground and USPS First Class & Priority orders by 11am ET Monday December 9, 2019 📬❄️📦 Attention all international customers! Please place all UPS WORLDWIDE EXPRESS; SAVER, and DHL EXPRESS WORLDWIDE orders by 11am ET Monday December 9, 2019 📬❄️📦
0

128x64, 1.3" OLED Bitmap Issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

128x64, 1.3" OLED Bitmap Issue

by georgeva3 on Thu Apr 24, 2014 9:54 am

Hello,

I have created a 30x30 icon and processed it via LCD Assistant to generate the following:

const unsigned char N3030 [] = {
0x00, 0x00, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0C, 0x06, 0x06, 0x03, 0x83, 0xE3, 0xF1, 0xFD, 0xFD,
0xF9, 0xE3, 0xC3, 0x03, 0x07, 0x06, 0x0E, 0x0C, 0x18, 0x38, 0x70, 0xC0, 0x80, 0x00, 0xFC, 0x3F,
0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFC, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0xFE, 0x0F, 0x3F, 0xF0, 0xC0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x78, 0x1F, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06,
0x0C, 0x1C, 0x18, 0x30, 0x30, 0x3F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F, 0x30, 0x30, 0x18
};

I use the example code and set the bitmap size as 30,30 and when I call the the code to render the bitmap (specify location 0,0 and size 30,30), the bitmap seems to be the correct size on the screen however it is scrambled. I have tried both vertical and horizontal orientation in LCD Assistant. All examples that I have seen provide binary mappings however LCD Assistant outputs in HEX and I am wondering if there are any issues with this. Can anyone shed some light on this issue for me.

Thanks in advance!

georgeva3
 
Posts: 8
Joined: Fri Jan 11, 2013 4:40 pm

Re: 128x64, 1.3" OLED Bitmap Issue

by adafruit_support_mike on Thu Apr 24, 2014 6:06 pm

That may be related to an update in our OLED or GFX libraries.. let me pass this one to our blinky-stuff sensei. He knows that code better than I do.

In the meantime, could you post a photo of what you get on the display please? Even the gibberish has meaning when it comes to toubleshooting.

adafruit_support_mike
 
Posts: 59639
Joined: Thu Feb 11, 2010 2:51 pm

Re: 128x64, 1.3" OLED Bitmap Issue

by pburgess on Thu Apr 24, 2014 7:18 pm

Try adding a PROGMEM before the icon data, see if that clears it up. e.g.:
Code: Select all | TOGGLE FULL SIZE
const unsigned char N3030 [] PROGMEM = {
...
};

Use the horizontal orientation and I think you're good.

pburgess
 
Posts: 4045
Joined: Sun Oct 26, 2008 2:29 am

Re: 128x64, 1.3" OLED Bitmap Issue

by georgeva3 on Thu Apr 24, 2014 7:42 pm

Sure, here you go.

This is what is displayed:

https://www.dropbox.com/s/pj0q0i6ysi5ytjn/2014-04-24%2019.19.40.jpg

It's suppose to look like this (except in 30x30 pixels):

https://www.dropbox.com/s/3k2wtozb1yyt5wn/N3030.bmp

Thank You!







adafruit_support_mike wrote:That may be related to an update in our OLED or GFX libraries.. let me pass this one to our blinky-stuff sensei. He knows that code better than I do.

In the meantime, could you post a photo of what you get on the display please? Even the gibberish has meaning when it comes to toubleshooting.

georgeva3
 
Posts: 8
Joined: Fri Jan 11, 2013 4:40 pm

Re: 128x64, 1.3" OLED Bitmap Issue

by georgeva3 on Thu Apr 24, 2014 11:35 pm

Thanks for your reply pburgess. I tried your suggestion however it did not resolve the issue. Any other suggestions would be appreciated.

Cheers!!

George

pburgess wrote:Try adding a PROGMEM before the icon data, see if that clears it up. e.g.:
Code: Select all | TOGGLE FULL SIZE
const unsigned char N3030 [] PROGMEM = {
...
};

Use the horizontal orientation and I think you're good.

georgeva3
 
Posts: 8
Joined: Fri Jan 11, 2013 4:40 pm

Re: 128x64, 1.3" OLED Bitmap Issue

by pburgess on Fri Apr 25, 2014 2:17 am

Was able to reproduce the problem. It's a bug in LCD Assistant (easy to confirm -- table for 30x30 bitmap should contain 120 values, it's only writing 112).

There's a workaround that's fairly simple and only mildly annoying:
1) Load original bitmap into Photoshop or editor of preference.
2) Change canvas size (pad on right, don't scale) so width is the next highest multiple of 8 (e.g. 32 pixels for 30x30 image). Height can be left alone.
3) Save padded bitmap.
4) Load bitmap into LCD assistant. Select 32 for width, 30 for height, horizontal orientation.
5) Save output.
6) Edit output to include PROGMEM before '='.
7) When drawing bitmap, use original (un-padded) dimensions, i.e.:
Code: Select all | TOGGLE FULL SIZE
  tft.drawBitmap(0, 0,  N3030, 30, 30, 1);

pburgess
 
Posts: 4045
Joined: Sun Oct 26, 2008 2:29 am

Re: 128x64, 1.3" OLED Bitmap Issue

by georgeva3 on Fri Apr 25, 2014 10:48 pm

Thank you so much pburgess! It now works perfectly.


Cheers!


pburgess wrote:Was able to reproduce the problem. It's a bug in LCD Assistant (easy to confirm -- table for 30x30 bitmap should contain 120 values, it's only writing 112).

There's a workaround that's fairly simple and only mildly annoying:
1) Load original bitmap into Photoshop or editor of preference.
2) Change canvas size (pad on right, don't scale) so width is the next highest multiple of 8 (e.g. 32 pixels for 30x30 image). Height can be left alone.
3) Save padded bitmap.
4) Load bitmap into LCD assistant. Select 32 for width, 30 for height, horizontal orientation.
5) Save output.
6) Edit output to include PROGMEM before '='.
7) When drawing bitmap, use original (un-padded) dimensions, i.e.:
Code: Select all | TOGGLE FULL SIZE
  tft.drawBitmap(0, 0,  N3030, 30, 30, 1);

georgeva3
 
Posts: 8
Joined: Fri Jan 11, 2013 4:40 pm

Please be positive and constructive with your questions and comments.


cron