Print Ascii for LCD Component Macro Hello World

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
wrreisen
Posts: 4
Joined: Sun Aug 11, 2019 3:43 pm
Contact:

Print Ascii for LCD Component Macro Hello World

Post 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.

User avatar
QMESAR
Valued Contributor
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

Post 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/

wrreisen
Posts: 4
Joined: Sun Aug 11, 2019 3:43 pm
Contact:

Re: Print Ascii for LCD Component Macro Hello World

Post 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.

User avatar
QMESAR
Valued Contributor
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

Post 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 4970 times

wrreisen
Posts: 4
Joined: Sun Aug 11, 2019 3:43 pm
Contact:

Re: Print Ascii for LCD Component Macro Hello World

Post 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
Attachments
help-asking-printascii-component-macro.fcfx
(3.93 KiB) Downloaded 221 times

User avatar
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

Post 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.

wrreisen
Posts: 4
Joined: Sun Aug 11, 2019 3:43 pm
Contact:

Re: Print Ascii for LCD Component Macro Hello World

Post by wrreisen »

Thank you

Post Reply