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!
128x64, 1.3" OLED Bitmap Issue
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: 128x64, 1.3" OLED Bitmap Issue
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.
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.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: 128x64, 1.3" OLED Bitmap Issue
Try adding a PROGMEM before the icon data, see if that clears it up. e.g.:
Use the horizontal orientation and I think you're good.
Code: Select all
const unsigned char N3030 [] PROGMEM = {
...
};
- georgeva3
- Posts: 8
- Joined: Fri Jan 11, 2013 4:40 pm
Re: 128x64, 1.3" OLED Bitmap Issue
Sure, here you go.
This is what is displayed:
https://www.dropbox.com/s/pj0q0i6ysi5yt ... .19.40.jpg
It's suppose to look like this (except in 30x30 pixels):
https://www.dropbox.com/s/3k2wtozb1yyt5wn/N3030.bmp
Thank You!
This is what is displayed:
https://www.dropbox.com/s/pj0q0i6ysi5yt ... .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
Thanks for your reply pburgess. I tried your suggestion however it did not resolve the issue. Any other suggestions would be appreciated.
Cheers!!
George
Cheers!!
George
pburgess wrote:Try adding a PROGMEM before the icon data, see if that clears it up. e.g.:Use the horizontal orientation and I think you're good.Code: Select all
const unsigned char N3030 [] PROGMEM = { ... };
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: 128x64, 1.3" OLED Bitmap Issue
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.:
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
tft.drawBitmap(0, 0, N3030, 30, 30, 1);
- georgeva3
- Posts: 8
- Joined: Fri Jan 11, 2013 4:40 pm
Re: 128x64, 1.3" OLED Bitmap Issue
Thank you so much pburgess! It now works perfectly.
Cheers!
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
tft.drawBitmap(0, 0, N3030, 30, 30, 1);
Please be positive and constructive with your questions and comments.