I'm using an app that displays messages on a SURE 3208 8x8 Led Matrix. It uses
the HT1632.h library routines. One of the routines (HT1632.drawText) will
display a single character passed to it as a const char. The specific parameter
is "const char text[]".
I would like to be able to take a string like char msg[] = {"message"}; and
iterate thru the string passing a single char to the HT1632.drawText function.
When I call the function with msg
- as the const char text[] paramerter, the
compiler complains that I can't convert char to const char. I've been unable
to find the right code that would allow me to iterate thru each char in
msg[] and pass this char to the HT1632.drawText function.
Anyone have an ideas how this might be done? Following is a code snipette..
I would like to be able to write a function that takes a char msg[] string
and breaks it down into single char that can be passed to the HT1632.drawText
function...
void loop()
{
char msg1[7] = {'T','U','N','E',' ',' '};
char msg2[7] = {'F','M',' ',' ',' ',' '};
char msg3[7] = {'1','0','7','.','3',' '};
int xstart;
int y = 1;
//message 1
HT1632.clear();
HT1632.render();
xstart = 4;
for(int z = 0, x = xstart; z < 6; z++, x+=6)
{
char val[1] = {msg1[z]};
HT1632.drawText(val, x, y, FONT_5X7, FONT_5X7_W, FONT_5X7_H, FONT_5X7_STEP);
}
HT1632.render();
delay(1000);
}
Moderator: CODE TAGS