problem displaying text from string array to lcd screen [SOLVED]

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

Moderator: Benj

Post Reply
gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

problem displaying text from string array to lcd screen [SOLVED]

Post by gavin mack »

I'm trying to display text from an array using a 0 to 9 counter and display text on an LCD screen

I have created variables byte ARRAY_INDEX INITIAL VALUE 0, AND string array DISPLAY_20X4[20]
I then added text to the array using a calculation box.
using component macro LCD_4x20 print string "hello world" works fine
using LCD_4x20 print number ARRAY_INDEX works fine
however when I try LCD_4x20 print string DISPLAY_20x4[ARRAY_INDEX], then an error occurs parameter1 is invalid: Can not convert to type ‘<- string[20]’ as shown in .jpg attachment.

please advise what I'm doing wrong and/or suggest a solution, flowcode file also attached
Attachments
p22_test_2.fcfx
(9.56 KiB) Downloaded 355 times
p22_test_2.jpg
p22_test_2.jpg (118.93 KiB) Viewed 6281 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by medelec35 »

Hi Gavin,
Welcome to Matrix forums.
When you want a string array, when creating the variable, you need to place the number of elements within the Array Length box.
Then click on Add Array Dimension.
All array Strings will require double not single quotes.
String Array.png
(75.08 KiB) Downloaded 3664 times
Attachments
p22_test_3.fcfx
(12.09 KiB) Downloaded 392 times
Martin

gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by gavin mack »

Hi Martin

thanks for the prompt reply. I have opened test 3 code in flowcode 7.
When I run the modified code test completed appears on 1st loop, then nothing on the screen for the other 9 loops.

i have added print number array_index to the lcd screen and when run this increments from 0 to9
Gavin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by medelec35 »

Hi Gavin,
You're welcome.
I Did try and post with V8.
Loaded Flowchart in V7 and it's working for me:
String Array2.png
(100.44 KiB) Downloaded 3649 times
Not sure why yours is not working?
Have you tried on hardware as well?

If you post modified flowchart, I will take a look at it.

I have move thread to a more appropriate section
Martin

gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by gavin mack »

Hi Martin

I haven't tried hardware yet, attached is test 4 code which I have a feeling it will work on your versions.
my flowcode is set to pic16f1937, clk:19660800hz
Gavin
Attachments
p22_test_4.fcfx
(10.48 KiB) Downloaded 387 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by medelec35 »

IF you select help, About Flowcode,
What version of 7 are you running?
Martin

gavin mack
Posts: 28
Joined: Wed Sep 26, 2018 2:15 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by gavin mack »

Stupid me, my version was 7.11, reinstalled latest version and everything works

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: problem displaying text from string array to lcd screen

Post by medelec35 »

That's great!
Thanks for letting us know.
I will change the topic to solved.
Martin

Post Reply