Maths help please


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    51

    Default Maths help please

    Hi, I have one MCP3204 connected to my my 877A. I am getting the 12bit reading fine. The sensor is hooked to a load sensor. My problem is that how Can I get the exact load from the reading. My load sensor is for 14tonns. So 4096 reading for 14 tonns. Each increment is for 3.41Kg. My problem is dealing with decimal numbers, can someone advise on how to deal with calculations like this ??????

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Maths help please

    Take the reading from your A/D and multiply it by 341. If your a/d sensor value is 1, then you will get 341 for 3.41 kg. You can set your lcd display to show this in the format of 3.41 if you like. Or you can divide the result by 100 and just end up with with 3 kg (no decimals).
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Re: Maths help please

    Hi,
    How about
    Code:
     
    kg=raw_value */ 875

    It's not perfect but is it enough?

    Or you might try
    Code:
    dummy = raw_value * 3419
    kg = DIV32 1000
    or perhaps
    Code:
    dummy = raw_value * 3419
    hg = DIV32 100
    HSEROUT["Result: ", #hg/10, ".", #hg//10, "kg", 13]
    If you have PBP2.60 or newer and you're able to use LONGS then there are other possibillities as well.

    /Henrik.

Members who have read this thread : 1

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