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.
Print Ascii for LCD Component Macro Hello World
Moderator: Benj
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Print Ascii for LCD Component Macro Hello World
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/
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/
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
Re: Print Ascii for LCD Component Macro Hello World
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.
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.
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Print Ascii for LCD Component Macro Hello World
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
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
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
Re: Print Ascii for LCD Component Macro Hello World
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
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
- Attachments
-
- help-asking-printascii-component-macro.fcfx
- (3.93 KiB) Downloaded 231 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Print Ascii for LCD Component Macro Hello World
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel