LCD BARgraphs


Closed Thread
Results 1 to 40 of 233

Thread: LCD BARgraphs

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: LCD BARgraphs

    Wow ! Amazing ! THANK YOU, Mr.Darrel !
    I will try to figure out how displaying ...

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: LCD BARgraphs

    Let's say I read maximum 50 volts and maximum 5 ampers ; so one "empty box" = 5 volts and one "filled box" = 0.5 ampers.
    It's this "pseudo" code correct ?!
    Code:
    for y=9 to 0 step -1
    if volts >= (y*5) then
        if ampers >= (y * 1/2) then
    char = 3
    LCDOUT $FE, $80, char,char,char,char,char,char,char,char,char,char
    Endif
    Endif
    I'm sure it's another way, much easiers, but I have -till now- no ideea ...

  3. #3
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default Re: LCD BARgraphs

    Untested, likely needs some debugging, but at least the methodology should be clear.

    Code:
    LCDPos	VAR BYTE
    volts	VAR WORD	' 0 to 500 representing 0 to 50.0 Volts
    Amps	VAR BYTE	' 0 to 50 representing 0 to 5.0 Amps
    Char	VAR BYTE	
    
    FOR LCDPos = 0 TO 9
    	IF Volts / 50 >= LCDPos + 1 THEN	' Fill in Volt Block
    		IF Amps / 5 >= LCDPos + 1 THEN		' Fill in Volt + Amp Block
    			Char = 3
    		ELSE					' Fill in Volt Block Only				
    			Char = 2
    		ENDIF
    	ELSE					' Don't Fill in Volt Block
    		IF Amps / 5 >= LCDPos + 1 THEN		' Fill in Amp Block only
    			Char = 1
    		ELSE					' Fill with Space				
    			Char = 32
    		ENDIF
    
    	ENDIF
    	LCDOUT 	$FE, $80 + LCDPos, Char	
    NEXT LCDPos
    Last edited by SteveB; - 25th January 2013 at 16:07. Reason: typo

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: LCD BARgraphs

    Thank You, I will post the results !

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. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  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