Scrolling Display £ symbol

Faversham?
Furness?
Falkirk?



BrianL:
I simply deleted the line numbered 35 which showed a # symbol at the end and copied and pasted your new line in. Saved it then the sketch containing the new line was uploaded to Arduino. When powered up the scrolling text displayed correctly and the £ sign was then present (In two places) but each has a preceding A immediately before the £. See screen shot 3 attachment

Screen shot 3.jpg
That is a very mangled display! Just hold the reset button to take a picture! OK, it is not an "A", so I wonder what it is?


Oh, silly me! :astonished: You have inserted a UNICODE symbol into your sketch, which is two bytes! To use the modified file, you must specify the pound as a simple "#".


BrianL:
Ctrl-T takes me to a New Tab in Google Chrome?

Ctrl-T in the Arduino IDE formats the sketch according to common "C" conventions, making it as readable as possible - at the expense of some neatness.

BrianL:
Now when I look at the MD_MAX72XX-font.cpp file 35 is the # see screen shot 1 below. But further down the code and sitting at 163 is a £ entry ?? See screen shot 2 So now I'm even more confused! :o

So it was unnecessary. You appear to have a different font file to mine - in mine, "Pounds" does appear as character 156 and most of the non-ASCII set is different. In fact, mine is almost but not quite standard IBMSCII while yours corresponds to a different code page!

Given this, I would advise restoring the original file if you can (since I gave you the original pattern for character 35) and you will see what happens then. The pound symbol is already there; you just have to specify it. I was getting excessively bold (or trying to make it too easy to write the characters).

hammy:
ASCII tables might give you a clue ?

Yes, the ASCII table! :grinning:

Paul__B:
Screen shot 3.jpg


Oh, silly me! :astonished: You have inserted a UNICODE symbol into your sketch, which is two bytes! To use the modified file, you must specify the pound as a simple "#".


Ctrl-T in the Arduino IDE formats the sketch according to common "C" conventions, making it as readable as possible - at the expense of some neatness.
So it was unnecessary. You appear to have a different font file to mine - in mine, "Pounds" does appear as character 156 and most of the non-ASCII set is different. In fact, mine is almost but not quite standard IBMSCII while yours corresponds to a different code page!

Given this, I would advise restoring the original file if you can (since I gave you the original pattern for character 35) and you will see what happens then. The pound symbol is already there; you just have to specify it. I was getting excessively bold (or trying to make it too easy to write the characters).
Yes, the ASCII table! :grinning:

So this is where I come unstuck!... Unicode in my sketch? Where is it? Only thing I've altered AFAIK is the scrolling text to be displayed and the pause time at end of display to zero.

I can restore the file to original and save it. How and where do I specify it? (The £ symbol) - Now that's where I started! :slight_smile:

What text editor did you use to modify the file? Maybe the editor does not work in ASCII text. Use a program like Notepad that works only only with ASCII text?

No, it is not the editor used to modify the MD_MAX72XX-font.cpp file, but inserting a Unicode character into the strings specified in the IDE that generates the double character. The "£" in the editor (as in this text) is two bytes.

If - using the modified file - you put "#" in your strings to be displayed, it will come out as "£". Otherwise you have to put char(163) into the string.

Thanks Paul__B, I will keep the .cpp file as original.
But how and where exactly would I enter char(163) in the sketch?? I'm not at all conversant with alterations and how to do them. I am an absolute beginner with no basic or C understanding, so I need hand holding!!!

Try

char newMessage[BUF_SIZE] = { "FMRC Exhibition 2019 Admission : Adult "+char(163)+"5.00  Child "+char(163)+"3.00  Under 5's free" };

With that replacing the original and when I run the 'Verify' command I get an error message (see screen shot below)....
Ironically if I insert a $ before 5.00 and 3.00 It works perfectly with the $ symbol showing correctly.

char newMessage[BUF_SIZE] = { "FMRC Exhibition 2019 Admission : Adult $5.00  Child $3.00  Under 5's free" };

If I change the $ to £ it then reverts to the (looks like) A£.
Without the £ or any other currency symbol it works correctly too.
It has to be something to do with the £ ???

BTW Note the Hardware is #define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
Not #define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW as this when used causes the text to be upside down and scroll form the wrong end! The ICSTATION_HW seems to work correctly (possibly?)

Please don't attach images of error messages. There is a "copy messages" button above the error message window. You can then paste them into your post between code tags.

You can't use + to concatenate strings in C, and there is no char() function. You can use + to concatenate Strings (the capital S makes a difference) but using Strings is discouraged because causes problems with MCU with small ram memories like Uno.

Try

char newMessage[BUF_SIZE] = { "FMRC Exhibition 2019 Admission : Adult \xA35.00  Child \xA33.00  Under 5's free" };

(163 is A3 in hex)

Tried your line in place of the original.. Made no difference. There are no £ signs displayed

But what did you see?

Try \x9C instead of \xA3.

@Paul__B why did you suggest 163? Did you find that in Marco's font files or something.

I have played around a bit. I added a space between \xA3 and the amount, so as its like \xA3 5.00 and it works
Thank you for all the help offered.

BTW to answer the question above... using the line as supplied allowed all other text to work but no £ symbol appeared. Adding the space has resolved it.

BrianL:
Adding the space has resolved it.

Did it also cause a space to appear between the £ and the 3?

PS. Still curious about my unanswered question from post #7.

I added a space for both £5 and £3 Now sitting here watching it scroll nicely :slight_smile:

Sorry, I have this bad habit of editing my messages and adding extra text if I think no one else has replied to the thread.

What I meant to ask was, has adding the space in the code caused an extra space to appear on the display, in addition to the £?

Yes there is a space between each £ symbol and the amount in both cases but it looks okay.
Faversham :smiley:

Hmm, well I'm glad you're happy with that space but it annoys me because I don't know how to get rid of it.

Is there a C expert reading this thread so knows the answer? Clearly, without an intervening space, the 5 in "\xA35.00"is interpreted as part of the hex value. But how to stop that without printing some unwanted (non-hex) character?

PaulRB:
Try \x9C instead of \xA3.

@Paul__B why did you suggest 163? Did you find that in Marco's font files or something.

Thank you for the correction on "C" strings. :sunglasses:

As I explained in #8, it seems the font file that BrianL has is not the same as I have, as presumably do you, which is essentially "IBMSCII", so the 165 matches his font file. To mine it would be 156. YMMV. I have not checked which version I have. :astonished: