Scrolling Text on 8 by 8 LED matrix: How can I add extra characters/emoticons?

First up I am very new to this and most of the sketches I use are pilfered from the internet!

I have 2 8x8 LED matrices that I have scrolling text on. I want to add extra characters/images, such as a space invader.

I have added extra lines to the "char_code[xxx] [6]" list, which compiles but I can't then use them tried many ascii character list to no avail , I have also tried adding extra "byte" characters but again I can't write them...

Not sure that is very clear but here is the bit of code I am playing with (character lines omitted!):

byte char_code[100][6] = {
{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}, // space
{B01011111, B00000000, B00000000, B00000000, B00000000, B00000000}, // !

{B01111111, B00000000, B00000000, B00000000, B00000000, B00000000}, // |
{B01000001, B00110110, B00001000, B00000000, B00000000, B00000000}, // }
{B00001000, B00000100, B00001000, B00000100, B00000000, B00000000}, // ~
{B00000000, B00000000, B11111111, B11111111, B11111111, B00000000}, //
{B00111100, B11110111, B00111100, B01111000, B00000000, B00000000}, //
{B01111000, B00111100, B11110111, B00111100, B00111100, B11110111}, //
{B01111000, B00111100, B11110111, B00111100, B00111100, B11110111}, //
{B00000000, B00000000, B01111000, B00111100, B11110111, B00111100} //

};

byte invader1a =
{B10011000, B01011100, B10110110, B01011111, B01011111, B10110110, B01011100, B10011000};

byte invader1b =
{B00011000, B11011100, B00110110, B00011111, B00011111, B00110110, B11011100, B00011000};

byte invader2a =
{B01111000, B00111100, B11110111, B00111100, B00111100, B11110111, B00111100, B01111000};

byte invader2b =
{B00011110, B10111100, B01110111, B00111100, B00111100, B01110111, B10111100, B00011110};

MAX7219 dotMatrix(5, data, load, clock);

void setup()
{
dotMatrix.begin();
dotMatrix.scanlimit(0x07);
dotMatrix.decodemode(0x00);
dotMatrix.shutdown(0x01);
dotMatrix.displaytest(0x00);
dotMatrix.intensity(0x0f);
dotMatrix.noop(0x00);
dotMatrix.clear();
}

void loop()
{

setStringWithShift("All I wanted was to scroll some space invaders");
setStringWithShift("Oh Well!!!");
}

  setStringWithShift("All I wanted was to scroll some space invaders");
   setStringWithShift("Oh Well!!!");

It would appear that one of the "characters" that it knows how to print/shift is invader2b.

   setStringWithShift(inveder2b);

No, just tried that and all I get is a long string of gibberish!

Trogglep:
No, just tried that and all I get is a long string of gibberish!

Then you need to post ALL of your code AND links (not just text; real clickable links) to the library(s) you are using.

Link to the libraries:

Code is attached:

Serial_LED_Working_Supanova_Extra.ino (9.42 KB)

It appears that you need to develop additional functions that take a single character. The ones you have now expect a string of characters that are used as indices into the char_code array.

Alternatively, you could add entries in the array before the space entry, and then pass hex values in the string using \xx notation, to print the "character" at position xx in the array.

Ah, Thanks.

I was trying to put entries in at the end of the array, not the beginning. Where would I find the information on which \xx notations I would use? I am still a bit baffled as to how the arduino knows which character is which!

I am still a bit baffled as to how the arduino knows which character is which!

Look at an ASCII table. A space is a 32. Somewhere, the code subtracts 32 from each "character" to get the index into the array. If you put more data in the array, you will need to adjust the offset that is used.

You could add to the end of the array. You'd still need to use the \xx notation to define the "character" to print, where xx is the array position + 32.

No still not working, I have looked up the ASCII tables, and tried calling up letters but I don't get a recognizable letter. I have tried backslash, forwardslash, in and out of quotation marks and nothing works... What am I doing wrong?

What am I doing wrong?

Not posting code. Not making any attempt to debug the code. Not posting the serial output, if you have many any attempt to debug the code.

Paul,

As I said in my initial question I am new to this, and have found some code that does most of what I need. To clarify this is something I am doing for my (Autistic) son, I would love to learn all the coding to the level required, but I don't have the time. So yes I am asking for a lot of help.

All the debugging I can do is seeing what works and doesn't... if it doesn't and I get an error code I can read that and try to work out whatto change, often I don't get any error code. Likewise I have no idea how to post serial output, beyond taking a picture.

What would help me is if you could give me the exact syntax I need to use. that way I can see if it's just my ignorance or something with the code. I have tried:

setStringWithShift("\xx");
setStringWithShift(\xx);
setStringWithShift('\xx');
setStringWithShift("/xx");
setStringWithShift(/xx);
setStringWithShift('/xx');

Where xx is a number of different hex codes that should call up standard characters

Some give no output, some give gibberish & some show what I typed as normal text.

What I did do last night is try to use extended ascii characters such as € ‚ ƒ etc... Of the 10 I tried only 2 worked, the others were corrupted, some corrupting even the "good" characters. What I don't understand is whether the ascii characters are wrong/not recognised or something more subtle in the code... I can upload this new code this evening if that would help?

If you can help that would be great.

The correct syntax is "\xx". What happens if you type:
setStringWithShift("abc\xxdef", where xx is the character (NOT the array index) that you want to print?

How did you add the extra characters?

I got it I got it!!!!!!

It's Octadecimal... I was putting in Hexadecimal...

working a treat now

Thanks for your help and patience.

One happy Kid (and Dad!), thanks again.