Help needed , arduino display 5110

Hi devs :)

i use this code : http://playground.arduino.cc/Code/PCD8544 i need somehow to enlarge the printed string or increase the font of it.

how can i do it , code help needed.

i dont use libraries because i have to save ram.

Regards

I read in a thread some time ago, that sometimes you can cut down the library size. Libraries often provide a bunch of features that not every user needs, so zap them and save the smaller library under a new name. Might be worth a look to see if a library that can do what you want, could be made smaller?

i need somehow to enlarge the printed string or increase the font of it.

You can learn from the ascii table that is already made for you in that example, and make your own. Right now it is a 5x8 pixel table, but you can make it a 10x16 if you need it to be really big, but keep in mind you will be the one writing it. Or you can get lucky and find something online to make it for you, but then you would need to write the function to read the table and draw the ascii characters.

Either way you will need to write something.

i dont use libraries because i have to save ram.

Then you don't understand the compilation and linking process, and don't know the difference between SRAM and Flash memory.

Using a library does not necessarily result in larger hex files or more SRAM being used.

PaulS:

i dont use libraries because i have to save ram.

Then you don't understand the compilation and linking process, and don't know the difference between SRAM and Flash memory.

Using a library does not necessarily result in larger hex files or more SRAM being used.

Then again you are just spamming and abusing. You are not helping....

I use just the right libraries with the smallest size they eat both in Sram and FLASH. The standard library i got from Sparkfun for 5110 eats half of Sram, even if i cut it to whati need it still took 35% of it.

So stop abusing and if you cant help DONT SPAM.

The reason your SRAM is being used up is because this array should be in your FLASH memory. If you want to save your SRAM then you need to look into PROGMEM and how it works. And yes it is going to be a library ;)

static const byte ASCII[][5] = { {0x00, 0x00, 0x00, 0x00, 0x00} // 20 ,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 ! . . . ,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c | ,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d } ,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ? ,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f ? };

So stop abusing and if you cant help DONT SPAM.

That was rude. Strike 1.

HazardsMind: The reason your SRAM is being used up is because this array should be in your FLASH memory. If you want to save your SRAM then you need to look into PROGMEM and how it works. And yes it is going to be a library ;)

static const byte ASCII[][5] = { {0x00, 0x00, 0x00, 0x00, 0x00} // 20 ,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 ! . . . ,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c | ,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d } ,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ? ,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f ? };

So stop abusing and if you cant help DONT SPAM.

That was rude. Strike 1.

I already use PROGMEM... my problem is how to make the array or generate one in order to get bigger font. Do i also have to change the functions. Thank you.

static const byte PROGMEM ASCII[][5] =
{
{0x00, 0x00, 0x00, 0x00, 0x00}, 
{0x00, 0x00, 0x5f, 0x00, 0x00},

my problem is how to make the array or generate one in order to get bigger font.
Do i also have to change the functions. Thank you.

When I made my Tron font, I did it painstakingly with paper and pencil. I made a 12x8 grid and mapped out each font character’s pixel.

The function was already made for me by the original library creator Henning Karlsen. However, if you keep the font the same height, and just change the width, then all you need to do is change the 5 to whatever width you made your font. If you change the height from 1 byte to 2 bytes (8 → 16, or somewhere in between like 12) then you will need to write the function to look at those extra bits.

TRONFont.c (6.66 KB)

HazardsMind:

my problem is how to make the array or generate one in order to get bigger font. Do i also have to change the functions. Thank you.

When I made my Tron font, I did it painstakingly with paper and pencil. I made a 12x8 grid and mapped out each font character's pixel.

The function was already made for me by the original library creator Henning Karlsen. However, if you keep the font the same height, and just change the width, then all you need to do is change the 5 to whatever width you made your font. If you change the height from 1 byte to 2 bytes (8 -> 16, or somewhere in between like 12) then you will need to write the function to look at those extra bits.

Thanks!