Using div32 to get decimal numbers


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Not sure what your trying to do but it looks like perhaps your NEXT W should be moved to between the LCDOUT and the ENDIF statements. Then, if you want to see it count on the display you'll probably need a short Pause in there a well.

    /Henrik.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Clinton

    @ first your counting method is wrong ... you should count transitions ( L> H i.e.) of your output sensor.
    @ second ... what's the reason of the " For w = 0 to 65 ..." loop ???
    @ third ... ----------------d°----- " W1 = W1 + W/65 " ???

    once that tied ... display should slow down a bit ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    ok..
    1- the loop, For W = 0 To 65, I meant to count pulses for 1 litre(65 pulses=1litre)
    so the value I would be storing in W1 will be(0+1), followed by (1+1), then (2+1) and so on.. every 65 pulses.

    The objective is to count litres and display the value on LCD.I realised that count by litres is not good since, e.g. 1 cup of water is not a litre,so I would miss that count.
    That is why I wanted to count at a better resolution of 1 pulse(=0.0154litres).

    I hope you understand my objective better now...
    Thanks for the input, it is appreciated.
    Looking forward to more help

  4. #4
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by nkwankwe View Post
    ok..
    1- the loop, For W = 0 To 65, I meant to count pulses for 1 litre(65 pulses=1litre)
    so the value I would be storing in W1 will be(0+1), followed by (1+1), then (2+1) and so on.. every 65 pulses.

    The objective is to count litres and display the value on LCD.I realised that count by litres is not good since, e.g. 1 cup of water is not a litre,so I would miss that count.
    That is why I wanted to count at a better resolution of 1 pulse(=0.0154litres).

    I hope you understand my objective better now...
    Thanks for the input, it is appreciated.
    Looking forward to more help
    hey..i cant seem to get anything right,maybe if you could write me a sample code,I'ld appreciate that

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts