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"
Scroll text
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Scroll text
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).
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).