Page 1 of 1

Print Ascii for LCD Component Macro Hello World

Posted: Sun Aug 11, 2019 4:26 pm
by wrreisen
I am following the book PIC Programmers for Non-Programmers and I have come to page 123 where it says how to create a component macro for an LCD so that it will write Hello World on the LCD. I can't work out how to put the suggested "Hello World..." into the expression window. If I do I get the message:
Parameter 1 is invalid:
Can not convert to type "byte"

Thanks for any advice.

Re: Print Ascii for LCD Component Macro Hello World

Posted: Sun Aug 11, 2019 4:47 pm
by QMESAR
HI.
Are you using Flowcode V6 ?
my advise is to post your flowchart that we can see what your problem is ,you can attach your Flowchart by using attachments button .
not many people,have the book you refer to and hard to see what your problem is
Have you tried to use the MATRIX learning center there are many example code and there are LCD examples

https://www.matrixtsl.com/learning/

Re: Print Ascii for LCD Component Macro Hello World

Posted: Mon Aug 12, 2019 9:09 am
by wrreisen
Hi,
Yes, thank you, I'm using Flowcode 6.
On page 61 of https://www.matrixtsl.com/resources/fil ... course.pdf
it recommends using the Call Component Macro PrintString so that works instead. Thank you.

Re: Print Ascii for LCD Component Macro Hello World

Posted: Mon Aug 12, 2019 3:25 pm
by QMESAR
Hi.
When using the printstring macro you need to enter the string and note it is a string of ASCII characters such as "12345" "ADGDE"
the macro expects a string and therefore what ever you enter in the macro as string example HELLO WORLD needs to be in double quotation marks to indicate it is a string so then you enter "HELLO WORLD"
in my example I have an string called Init so "Init" is entered in the parameter box

I hope h help you
P1.jpg
P1.jpg (63.47 KiB) Viewed 4985 times

Re: Print Ascii for LCD Component Macro Hello World

Posted: Tue Aug 13, 2019 11:16 am
by wrreisen
Hi,

I think I've got the print string working fine. I would like to understand how to use PrintAscii to print a simple message on the screen too, please? Have attache the flowchart and done this video:
hhttps://youtu.be/DwzTnjaM3tA

Re: Print Ascii for LCD Component Macro Hello World

Posted: Tue Aug 13, 2019 12:24 pm
by Benj
Hello,

The PrintASCII function allows you to print a single ASCII character.

for example.

'x' or 'A' or 'b' or '\n'

The single quotes allow you to enter a single ASCII character and the compiler will convert this to the ASCII binary value.

Flowcode v5 and previous used to allow you to enter strings in the PrintASCII function and would auto convert to multiple calls using individual characters.

e.g.

PrintASCII "Hello"

would become

PrintASCII 'H'
PrintASCII 'e'
PrintASCII 'l'
PrintASCII 'l'
PrintASCII 'o'

We got rid of this as it was seldom used, confusing and as we had proper string support it was no longer required.

Hope this helps.

Re: Print Ascii for LCD Component Macro Hello World

Posted: Tue Aug 13, 2019 6:42 pm
by wrreisen
Thank you