Hello,
I would like to get help for getting a character from a font.
I have a Flipdot display with 28x28 "pixels" and want to display text on it.
The display and the selfmade driver board is running well.
I can switch on/off single dots and as well send patterns in byte format via SPI to the shift registers and
sink/source drivers will then flip the dots.
For displaying text my ideas is to
- create a user string
- select character by character of the user string
- get the ASCII code of the character
- select with this ASCII code the byte sequence of the font
- sent this byte sequence via SPI
I think that could be a way how to do it - but for point 3 and 4 I don't know how.
That's the font I want to use:
What I have done already is following. For testing I copied the byte sequence for some characters
from the font directly to my code and sent this via SPI. This works.
static unsigned char A5x7[] = {
0x7C, 0x12, 0x11, 0x12, 0x7C, // A
};
static unsigned char B5x7[] = {
0x7F, 0x49, 0x49, 0x49, 0x36, // B
};
static unsigned char C5x7[] = {
0x3E, 0x41, 0x41, 0x41, 0x22, // C
};
static unsigned char P5x7[] = {
0x7F, 0x09, 0x09, 0x09, 0x06, // P
};
But now I want to do somethink like this:
String userstring = "Hello World!";
get ascii of H = 72 (this is the DEC of "H", or 0x48 in HEX);
Look into the font5x7.h where I can find DEC 72 or HEX 0x48;
H = 0x7F, 0x08, 0x08, 0x08, 0x7F;
SPI.transfer;
Loop for next character of the userstring.
When I check the font5x7.h I can't find the DEC 71 or HEX 0x48 where I can look for to select the correct bytes for "H".
I have no clue how to do it and also not if this is a good way. May be it is possible to get the complete userstring
at once in ASCII and byte sequence?
Many thanks for your help,
Theo