Go Down

Topic: Looking for text display on OLED (will pay) (Read 397 times) previous topic - next topic

zaylenek

Nov 08, 2018, 05:53 pm Last Edit: Nov 21, 2018, 01:21 am by zaylenek
Hey guys,

I'm looking for someone to assist me with a project with the following:
- A function to take in a string of text and have that displayed starting from any point within the screen. Something like; print_text(0,0,"Hello world"); Note - the 0,0 refers to the x,y pixel starting position on the screen.

The OLED I'm using is uncommon and does not have a library.

wvmarle

128 * 36 * 3 = 13,824 bytes for a single image. That's a lot to store in an Arduino's tiny memory. Now if you'd use an ESP8266 it'd be a lot easier. You'd get up to 3 MB worth of flash for images if you use an ESP-12, or you can roll your own to make it smaller.

And what you mean, no library for that display? That was a <1 minute search.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

IndianaTux

Yeah was about to write the same that a 328p only has 32K of flash (minus 512 bytes for the bootloader). So your going to eat up almost half of your flash for a single image...

zaylenek

Thanks for the feedback! I do plan to use another microcontroller because of the memory issue but for the moment I want just want prototype with what I have.


Also, the libraries I found online are not compatible with the OLED driver.

IndianaTux

Did you test your code with the said Oled screen/driver ? Does it work ?

zaylenek

Did you test your code with the said Oled screen/driver ? Does it work ?

I did and it displays the bitmaps perfectly. But it reads the bitmaps directly from the SD card and I want them to be read from flash with needing an SD card.

IndianaTux

Just put the image you have on the SD card in hex format in an array like this:


Code: [Select]
prog_char my_image[] PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0x18, 0xf1, 0xee, 0xab, 0xff, 0xcc, 0xff, 0xee, 0xff,
0xef, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xee, 0xff, 0xcf, 0xff, 0xab, 0xff, 0x6a,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xf6, 0xc3, 0xfe,
0x6a, 0xff, 0xaa, 0xff, 0xcd, 0xff, 0xcc, 0xff, 0xcd, 0xff, 0xed, 0xff, 0xee
};



And read from there instead of from the file.

Here is a post that does this exactly: http://forum.freetronics.com.au/viewtopic.php?t=5959

wvmarle

You can store at most two images in local flash - that is, if your code fits in the other 6k flash. That's not much to work with.

You could try to prototype but it doesn't make much sense as the moment you switch to say the ESP8266 you're going to need a different way again to read the images, as you'll be using the SPIFFS file system instead. That means you basically can do a "blink" type sketch showing one then the other image.

You got your display to work, and display images, that's about as far as you can prototype on the ATmega328p. It's just not suitable a processor for this application. So just get yourself a NodeMCU or WeMOS mini - they're cheap and readily available all over the world, so no doubt also in your locality - and prototype on something that actually can do what you want it to do.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up