More Powerful LCD Commands


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Sorry i don't follow you could you shed some light on that?

    Why not updating only some fields on the LCD? Do you need Left/Right Aligned thingy?

    if you say this:


    VAR = 1
    LCDOUT $FE, 1, " ", DEC VAR 'three spaces

    you will get on the screen
    >___1< but lets say your variable becomes 100, you will get:
    >___100< i want to get it to say:
    >_100<


    so the first digit of the variable is the "setpoint," and if its one or 5 digits long, the first one will always be in the same place. not too big of a deal, but if you want to run 2 or 3 variables on the screen at the same time (and vary from 1 to 100), then it kinda sucks to program that....

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by reaper0995 View Post
    if you say this:


    VAR = 1
    LCDOUT $FE, 1, " ", DEC VAR 'three spaces

    you will get on the screen
    >___1< but lets say your variable becomes 100, you will get:
    >___100< i want to get it to say:
    >_100<


    so the first digit of the variable is the "setpoint," and if its one or 5 digits long, the first one will always be in the same place. not too big of a deal, but if you want to run 2 or 3 variables on the screen at the same time (and vary from 1 to 100), then it kinda sucks to program that....
    This is why i asked
    Why not updating only some fields on the LCD?
    just clear the specific LCD areas where you need to write to.. then yes you must implement some kind of text justification. For that, you'll need to implement a kind of LEN(YourVar) who return the length of your variable, amount of character.

    Think about a simple loop, begin with a variable (says LENof) set to 1. Divide your variable to display by ten.. if the result is still greater increment Lenof variable... loop until your result is still greater than 10. once your done, you know the LENof your variable. Then it's just a matter to use or not REP " "\AmountOfSpace the right way for your text justification.

    That's one way.
    Last edited by mister_e; - 21st April 2008 at 20:31.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

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