scrolling text input? for pic18f4520 with 2x16 lcd


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

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

    Might want to compare cursor position with 0,1,2 and 3 when checking the buttons instead of only 0 and 1 no?

    Can you even use cursor position 0? Or does it start at 1?

    I think you have them backwards, the units would be at position 3, tens at position 2 and so on.

    But yeah, that's a perfect starting point to start building on.

    Robert

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

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

    Quote Originally Posted by Demon View Post
    Might want to compare cursor position with 0,1,2 and 3 when checking the buttons instead of only 0 and 1 no?

    Can you even use cursor position 0? Or does it start at 1?

    I think you have them backwards, the units would be at position 3, tens at position 2 and so on.

    But yeah, that's a perfect starting point to start building on.

    Robert
    Whoops, ... copy & paste & forgot to adjust
    Code:
    IF downbutton = 1 THEN
    IF cursorposition = 0 THEN
    value = value - 1
    ENDIF
    IF cursorposition = 1 THEN
    value = value - 10
    ENDIF
    IF cursorposition = 2 THEN
    value = value - 100
    ENDIF
    IF cursorposition = 3 THEN
    value = value - 1000
    ENDIF
    and do the same with te up button.
    Also need a pause for button debounce, so

    Code:
    pause 500
    straight after each button check
    cursorposition = 0 is the thousands position.
    The thousands digit is the first to be printed to LCD,
    so no movement needs to occur from cursor home command.

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

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

    And the other thing you mentioned...
    I need to build a generic test circuit before posting code

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

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

    Just to be sure, I wasn't being sarcastic.

    I wanted to post an attempt, but it's easier for me to pick at others.

    Robert

  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

    Quote Originally Posted by Demon View Post
    Just to be sure, I wasn't being sarcastic.

    I wanted to post an attempt, but it's easier for me to pick at others.

    Robert
    Not taken that way at all... good catches

  6. #6
    Join Date
    Feb 2012
    Posts
    6


    Did you find this post helpful? Yes | No

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

    guys

    I manage to get the lcd working with the cursor responding to the left right navigation button

    now , I have a problem with the change of letter

    lets say if I want the 1st letter to be from 0,1,2,3,..,9,A,B,C

    I am thinking of 012345679ABC as a string, then move from bit to bit

    or should I get an array of 13, then point to it

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

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

    This is totally off the top of my head, no code:

    Use an array with 1 element for each character on display.
    - if 4 characters, then use 4 elements starting at 0.

    Store the position of each character in the array.
    - character 1 starts at 0 on startup, so array(0)=1.

    Use a lookup table to display each character.

    Lcdout (clear screen)
    For element = 0 To 3 (if using 4 characters)
    Lookup array(element),[0,1,2,3,4,5,6,7,8,9,A,B,C],byteout
    Lcdout byteout at next position on display
    Next element

    -syntax must be corrected.
    - never used lookup so not sure if it starts at 0 or 1.
    - I remember concatenating characters on the same LCD line, somewhere.


    Ok Art, now it's your turn.

    Robert

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