Go Down

Topic: Scrolling Display £ symbol (Read 501 times) previous topic - next topic

PaulRB

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.


PaulRB

#16
Jul 21, 2019, 05:57 pm Last Edit: Jul 21, 2019, 06:05 pm by PaulRB
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
Code: [Select]
char newMessage[BUF_SIZE] = { "FMRC Exhibition 2019 Admission : Adult \xA35.00  Child \xA33.00  Under 5's free" };

(163 is A3 in hex)

BrianL

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

PaulRB

#18
Jul 21, 2019, 06:27 pm Last Edit: Jul 21, 2019, 06:36 pm by PaulRB
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.

BrianL

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. 

PaulRB

#20
Jul 21, 2019, 06:38 pm Last Edit: Jul 21, 2019, 06:40 pm by PaulRB
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.

BrianL

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

PaulRB

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 £?

BrianL

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

PaulRB

#24
Jul 21, 2019, 07:51 pm Last Edit: Jul 21, 2019, 07:56 pm by PaulRB
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?

Paul__B

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.    :smiley-cool:

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.  :smiley-eek:

Go Up