Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRIO LCD UART Demo and Scrolling Text

Solved!
Go to solution

Hello,

 

I am working through the examples that came with the myRIO, specifically the UART LCD demo. The demo works fine. I then took the demo and expanded it to receive some data from a sensor over CAN bus and to display some of the data on the LCD. The problem I am having is the text on the LCD screen starts scrolling right to left, and the rows will switch places after each scroll.

 

The screen is initialized to word wrap at 16 characters. None of the data I am trying to display is longer than 16 characters, so I am not sure the word wrap is the issue. When I display some numbered data, with the string formatting manually set to use a minimum field length that makes the row of characters add up to exactly 16 the text does not scroll. If I try to display a string of letters (16 characters or less) the text starts scrolling and switching the row it is displayed on after each scroll, and this causes the orientation of anything that is displayed after this to be offset from where I intended it to be, even if I clear the screen and return the cursor to home position before each instance of writing to LCD.

 

Do I need to format every string to to fill each row with exactly 16 characters (pad with spaces?) to get this scrolling to stop? Is there a way to have data written to the LCD in a dynamic way that it will be in the proper format to not cause this scrolling?

 

Any help is appreciated!

0 Kudos
Message 1 of 2
(3,435 Views)
Solution
Accepted by topic author StevoP80

I solved my own issue. Each string needs to be formatted with the "format into string" function, and set to use a minimum field width of 16 characters, regardless of what the actual length of the string is (if less than 16). Also, both lines of the display must be written to, or the display will repeat the first line on the second line.

Message 2 of 2
(3,412 Views)