Displaying a percentage


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Displaying a percentage

    Thanks Henrik,

    Is there a way to get better resolution ?

  2. #2
    Join Date
    Feb 2005
    Location
    brookfield, ct, usa
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: Displaying a percentage

    X = 4096 * 100
    Percent = div32 value
    Lcdout (dec2 percent)

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Displaying a percentage

    Is there a way to get better resolution ?
    To get .1% is easy, same aproach:
    Code:
    Percent = Value ** 16000   ' Percent is now 0-1000
    LCDOUT $FE, 1, Percent / 10, ".", Percent // 10
    Since you've got slightly over 4000 counts the smallest unit is around 0.025% but I don't know if you need, or even want, the display to show that?

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Displaying a percentage

    Or you could do it this way as there is no need to do another math operation on the variable:

    Percent = Value ** 16000 ' Percent is now 0-1000
    LCDOUT $FE, 1, Percent / 10, ".", Percent DIG 0

    Just format the variable....
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Displaying a percentage

    many thanks guys, I'll give it a go when I'm home from work

Similar Threads

  1. Displaying strings from codespace.
    By Byte_Butcher in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th March 2010, 20:32
  2. Displaying Weather Statistics
    By Bill Legge in forum Off Topic
    Replies: 12
    Last Post: - 12th October 2009, 09:09
  3. Displaying temperature Setpoints
    By Kalind in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 27th October 2008, 14:52
  4. Displaying temperature using a -40 to 185F??
    By jblackann in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th January 2008, 18:45
  5. Displaying numbers
    By Christopher4187 in forum General
    Replies: 8
    Last Post: - 20th March 2006, 23:14

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