Page 1 of 1

Scroll text

Posted: Wed Apr 27, 2011 7:03 pm
by Jan Lichtenbelt
I have 3 texts of which I will show one on a LCD screen. In the program attached, I defined 3 strings. By means of a string-counter and a switch, I copy one of the 3 strings to the "actual" string, which will be shown on the LCD screen.
Is there an other, more easy, way?

Kind regards

Jan Lichtenbelt

PS. this is a MIAC program, but can be used for other controllers also. The switch can be found at "select string"

Re: Scroll text

Posted: Thu Apr 28, 2011 9:45 am
by Steve
It is ok to do this, but there may be a slightly better way...

If you are only using this "action" string once at that part of the program, you could instead remove the "str1", "str2" and "str3" variables and instead put PrintString("start"), PrintString("stop"), or PrintString("reset") in the switch statement. It will be a little quicker and also reduce the amount of RAM needed.

Alternatively, if you do require the specific strings in multiple places and you don't need simulation, you could embed them into the ROM of the device as constant strings (you'll need to do this in C code).