scrolling text input? for pic18f4520 with 2x16 lcd


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Default scrolling text input? for pic18f4520 with 2x16 lcd

    scrolling text input? for pic18f4520 with 2x16 lcd


    I tried googled, but couldn't get what I want, probably got the searching terms wrong

    basically I want to input letters like in the below video, scroll from 0 to Z



    could anyone tell me what is this method call? I do need sample codes, to work with too

    thanks alot for reading

  2. #2
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    There is no scrolling text in that video. That is just the cursor showing which digit is to be changed, and a set of buttons to toggle the value of that digit. Is this what you are trying to do? Do you have an LCD setup with the ability to display characters onto it already?
    Shawn

  3. #3
    Join Date
    Feb 2012
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    Quote Originally Posted by spcw1234 View Post
    There is no scrolling text in that video. That is just the cursor showing which digit is to be changed, and a set of buttons to toggle the value of that digit. Is this what you are trying to do? Do you have an LCD setup with the ability to display characters onto it already?
    oh yes, I have the buttons and lcd integrated, and is displaying "hello world"

  4. #4
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    You need to create a variable to display that the button will toggle.

    Do you have some code started that you can post up?
    Shawn

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    Something like:
    Code:
    
    value var word
    incvalue var word
    cursorposition var byte
    
    
    **LCD setup code here **
    
    LCDOUT $FE, $0F        'turn blinking cursor on
    cursorposition = 0    'reset cursor position
    
    
    dostuff:
    
    LCDOUT #value DIG 3
    LCDOUT #value DIG 2
    LCDOUT #value DIG 1
    LCDOUT #value DIG 0
    
    IF upbutton = 1 THEN
    IF cursorposition = 0 THEN
    value = value + 1
    ENDIF
    IF cursorposition = 1 THEN
    value = value + 10
    ENDIF
    IF cursorposition = 1 THEN
    value = value + 100
    ENDIF
    IF cursorposition = 1 THEN
    value = value + 1000
    ENDIF
    
    IF downbutton = 1 THEN
    IF cursorposition = 0 THEN
    value = value - 1
    ENDIF
    IF cursorposition = 1 THEN
    value = value - 10
    ENDIF
    IF cursorposition = 1 THEN
    value = value - 100
    ENDIF
    IF cursorposition = 1 THEN
    value = value - 1000
    ENDIF
    
    IF leftbutton = 1 THEN
    IF cursorposition > 0 THEN
    LCDOUT $FE, $10        'move cursor left
    cursorposition = cursorposition - 1
    ENDIF
    ENDIF
    
    IF rightbutton = 1 THEN
    IF cursorposition < 3 THEN
    LCDOUT $FE, $14        'move cursor right
    cursorposition = cursorposition + 1
    ENDIF
    ENDIF
    
    IF confirmbutton = 1 THEN
    '** go back to, or continue the main program here
    ENDIF
    
    goto dostuff

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    oops, straight after the dostuff: label,

    Code:
    LCDOUT $FE,2                                    'LCD cursor return home
    FOR count = 0 TO cursorposition
    LCDOUT $FE, $14        'move cursor right
    NEXT count
    to set up the display for the next frame.
    None of this is tested, but you should get the idea.

  7. #7
    Join Date
    Feb 2012
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: scrolling text input? for pic18f4520 with 2x16 lcd

    thanks, I will try out myself this week, get back here with any progress and problem

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts