Page 1 of 1

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

Posted: Wed Sep 26, 2018 3:03 pm
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

Re: problem displaying text from string array to lcd screen

Posted: Wed Sep 26, 2018 3:44 pm
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

Re: problem displaying text from string array to lcd screen

Posted: Wed Sep 26, 2018 4:08 pm
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

Re: problem displaying text from string array to lcd screen

Posted: Wed Sep 26, 2018 4:45 pm
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

Re: problem displaying text from string array to lcd screen

Posted: Wed Sep 26, 2018 5:12 pm
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

Re: problem displaying text from string array to lcd screen

Posted: Wed Sep 26, 2018 5:31 pm
by medelec35
IF you select help, About Flowcode,
What version of 7 are you running?

Re: problem displaying text from string array to lcd screen

Posted: Thu Sep 27, 2018 9:20 am
by gavin mack
Stupid me, my version was 7.11, reinstalled latest version and everything works

Re: problem displaying text from string array to lcd screen

Posted: Thu Sep 27, 2018 9:32 am
by medelec35
That's great!
Thanks for letting us know.
I will change the topic to solved.