How do I numerically refer to consecutive (single-character) string literals?

I created a custom font using the MD_MAX72xx library’s font-builder tool. Attached is a sketch utilizing the custom font and the font file itself. The sketch creates a short little animation of a beating heart icon by looping through font characters (each of which is a frame of the animation) and updating the display by calling animate().

The first defined character is placed at ascii 98 (corresponding to the lowercase character ‘b’). To display a character, I have to create a string literal that is the ascii correspondence to the defined font character. Then, I need to pass that literal as the first argument to displayText(). For instance:

MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);    
P.displayText("b", PA_LEFT, 0, 0, PA_PRINT, PA_NO_EFFECT);

will display the font character that corresponds to ascii “b” (98). To access the next character, I need to substitute “b” for “c”, and so on and so forth.

displayText() takes a char* as its first argument (I think it expects a pointer to a string literal). Is there a way to numerically refer to consecutive (single-character) string literals?

So that I can do something like:

//Cycle through all letters of the alphabet
for(int i=0; i<26; i++)
    P.displayText("a"+i, ...); 

Lastly, how do I refer to non-displayable characters as a literal?

BeatingHeart.ino (880 Bytes)

bh_font.h (3.39 KB)

First char in a string is index 0 of the array of characters, so s[0]. The library is looking for a pointer to a char array, so set it up as a variable, not a constant like you currently have.

To embed non displayable character as a literal use the escape sequence '' before the char code in decimal or hex. Look up "C ascii escape sequence" for full info.