Moving menu down in LCD


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2014
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Moving menu down in LCD

    Thank you Art, but rotatearray is not working for me.

    To simplify the question, I used text on the left side as: V1, V2, V3 but actually they are different strings, that is what creates the problem.

    1.MY FIRST VARIABLE=20
    ================
    2.SECOND VALUE =25
    3.THIRD ONE =30
    4.DIFFERENT >40
    5.FIFTH VAR =50
    ================
    6.SIXTH VAR =60

    Since I can only show 4 lines on the LCD, when the user presses DOWN button I need to know the following:
    selected_variable: Which variable is the user currently on (in the above example: 4)
    first_line_displayed: Which lines should be displayed OR which line should be on the top (in the above example: 2)

    Here is a table I created:
    Name:  1.png
Views: 502
Size:  15.6 KB
    Dark grey is the currently selected variable
    Light grey are displayed in the LCD

    Based on this table:
    first_line_displayed = selected_variable - 2
    IF (selected_variable - 2 <= 0) THEN first_line_displayed = 1
    IF (selected_variable = max_number_of_variables) THEN first_line_displayed = selected_variable - 3

    This very simple method works for display purposes. However, the problem is I cannot form a loop to go through all 8 (or less/more) variables and display only the ones that should be played based on the table above (and on the correct place). Can you help me form such a loop?

  2. #2
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: Moving menu down in LCD

    I think that Select and Case will work:

    DG=Dark Grey number
    LSD = Line Start Display
    MNV = Max Number of Variables

    Select case DG
    Case is < 4
    LSD = 1 : GOSUB Display
    Case is 4 to MNV - 1 'MNV calculated or hard coded. Only first 3 and last one are special cases.
    LSD = DG - 2 : GOSUB Display
    Case = MNV
    LSD = MNV - 3: GOSUB Display
    End select




    Display:
    For LP = LSD to LSD + 3
    DIPLAY LINE LP
    NEXT LP
    Return
    Last edited by Amoque; - 26th August 2015 at 15:06.

Similar Threads

  1. LCD menu
    By malc-c in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st April 2010, 18:22
  2. lcd menu problems
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd April 2009, 20:00
  3. LCD menu
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th February 2009, 10:02
  4. Moving the LCD
    By PICante in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th April 2008, 02:03
  5. Lcd Menu
    By eliecer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2005, 20:29

Members who have read this thread : 1

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