Adding ascii % symbol to LCD display
-
- Posts: 78
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 3:54 pm
- Has thanked: 6 times
- Been thanked: 11 times
Adding ascii % symbol to LCD display
I am displaying a number that can vary from 1 to 3 digits on a 16 x 2 LCD module. The number is always placed at char position 12 and therefore takes up either the 12th position, the 12 and 13th position or the 12th, 13th and 14th position. Can someone please show me the command to write into the LCD macro line that will add the % character immediately after the last digit to the right of the number? I think the number has to be inserted into a string denoted by " " but I can't for the life of me remember how to do it.
-
- Matrix Staff
- Posts: 1464
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 514 times
- Been thanked: 474 times
Re: Adding ascii % symbol to LCD display
Hello.
The easiest way is to use
If the number goes from 255 to 3 for example, the two spaces between % and "ensure the unwanted 55 digits are erased.
You won't require a cursor command prior to the PrintString function.
The easiest way is to use
Code: Select all
PrintString "% "
If the number goes from 255 to 3 for example, the two spaces between % and "ensure the unwanted 55 digits are erased.
You won't require a cursor command prior to the PrintString function.
Martin
-
- Posts: 78
- Joined: Thu Dec 10, 2020 3:54 pm
- Has thanked: 6 times
- Been thanked: 11 times
Re: Adding ascii % symbol to LCD display
Thanks Martin. That should work nicely.
So you're saying the solution is to add the PrintString function after I have done the PrintNumber.
FYI I thought there was a way to insert the number with the PtintString % as one function but my memory is fuzzy and I may be thinking back to earlier code development before I switched to using Flowcode.
So you're saying the solution is to add the PrintString function after I have done the PrintNumber.
FYI I thought there was a way to insert the number with the PtintString % as one function but my memory is fuzzy and I may be thinking back to earlier code development before I switched to using Flowcode.
-
- Posts: 78
- Joined: Thu Dec 10, 2020 3:54 pm
- Has thanked: 6 times
- Been thanked: 11 times
Re: Adding ascii % symbol to LCD display
Martin
Just to confirm, it does all work as expected and as you pointed out it has also eliminated a few cursor command functions in the flowcode.
Just to confirm, it does all work as expected and as you pointed out it has also eliminated a few cursor command functions in the flowcode.
-
- Matrix Staff
- Posts: 1464
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 514 times
- Been thanked: 474 times
Re: Adding ascii % symbol to LCD display
Sorry yes, I should have said to add the PrintString directly after the PrintNumber function.
Thank you for confirming it's working for you.
Thank you for confirming it's working for you.
Martin