store array of bytes

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
philcr
Posts: 24
Joined: 24 Jul 2014 09:37

store array of bytes

#1 Post by philcr » 13 Jan 2015 23:02

I have a 128 x 64 oled screen that uses i2c, I have a library written for arduino and know enough to convert the methods etc. However I am stuck on the font description the font is stored in a two dimensional array of bytes. In progmem is there something similar in pic that won't impact ram too much I have 12th of program space but I don't think a constant array would do the right thing.

Many thanks in advance

Phil

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: store array of bytes

#2 Post by janni » 13 Jan 2015 23:47

Flash seems the best choice to store fonts - why do you think a constant array is not a good solution?

philcr
Posts: 24
Joined: 24 Jul 2014 09:37

Re: store array of bytes

#3 Post by philcr » 14 Jan 2015 07:42

Flash is that eeprom? I thought constants were inserted at compile time as a substitution of the word. I didn't think that the whole constant array would be stored in rom.

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: store array of bytes

#4 Post by marina.petrovic » 14 Jan 2015 11:02

Hi,

You can read more about constants in compiler Help file: mikroPascal PRO for PIC Language Reference -> Constants.

You can take a look at some example from compiler to see how we declared fonts in our projects (TFT fonts), for example:
...\mikroPascal PRO for PIC\Examples\Development Systems\mikromedia for PIC18FJ\Calculator)

In "Calculator_resources.mpas" file you can see that we declared fonts as const array.

Best regards,
Marina

philcr
Posts: 24
Joined: 24 Jul 2014 09:37

Re: store array of bytes

#5 Post by philcr » 15 Jan 2015 11:18

Hi Guys,

Thank you for the responses, very much appreciated.

Regards

Phil

Post Reply

Return to “mikroPascal PRO for PIC General”