LCD automatic management?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1

    Default LCD automatic management?

    Greetings,

    I finished one more aplication but i just dont like the visual outcome on my LCD.

    I have a common 16x2 LCD and i have a screen where i have on the first line the Max value, Average value and minimum value indications and for the second line shows the values.

    The problem is that with 3 digit values the spacing is correct, but with 1 digit values the spacing is way off ( please see attached pictures ).
    There would be nice if the values were always under the names.

    Is there a simple way or making it automatic to manage the screen according to the value sizes ?

    Thanks
    Attached Images Attached Images   

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looks like you are just putting a "space" between the values on the second line.

    The first position on the second line is 80. If you always want something to start at the second position then tell it to start at 80+2., then the nest set of data could start at 80+7 and so on.

    The only problen is if the data is to long to fit in the space provided.
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    thanks for your help

    The values will only have 3 digits max.

    This is the code i used:
    Code:
    lcdout $fe,2," MAX  AVG  MIN  " 
    lcdout $fe,$c0," ",DEC MAXIMO,"C ",DEC MEDIA,"C ",DEC MINIMO,"C     "
    I'm not able to try this now, but your sugestion is something like this ?

    Code:
    lcdout $fe,2," MAX  AVG  MIN  " 
    lcdout $fe,81,DEC MAXIMO,"C"
    lcdout $fe,87,DEC MEDIA,"C"
    lcdout $fe,8c,DEC MINIMO,"C"
    My best regards
    Rui

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    CORRECTION... I said second line 80... C0 is correct.

    So
    Code:
    lcdout $fe,2," MAX  AVG  MIN  " 
    lcdout $fe,C0,DEC MAXIMO,"C" 'Starts at fist space
    lcdout $fe,C6,DEC MEDIA,"C"    'Starts at space 6
    lcdout $fe,CB,DEC MINIMO,"C"  'Starts at space 11
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    thanks

    .

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    CORRECTION... I said second line 80... C0 is correct.

    So
    Code:
    lcdout $fe,2," MAX  AVG  MIN  " 
    lcdout $fe,C0,DEC MAXIMO,"C" 'Starts at fist space
    lcdout $fe,C6,DEC MEDIA,"C"    'Starts at space 6
    lcdout $fe,CB,DEC MINIMO,"C"  'Starts at space 11
    Ahem: 80 <>$80
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Ahem: 80 <>$80
    OOPPS

    Thanks Joe
    Code:
    lcdout $fe,$C0,DEC MAXIMO,"C" 'Starts at fist space
    lcdout $fe,$C6,DEC MEDIA,"C"    'Starts at space 6
    lcdout $fe,$CB,DEC MINIMO,"C"  'Starts at space 11
    Dave
    Always wear safety glasses while programming.

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. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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