PbPro Maths Help


Results 1 to 15 of 15

Threaded View

  1. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    I don't get it.... $18 and $7F is 24 and 127 respectively. Putting these in the formula should result in "real life values" ranging from -100 to 50 representing the current in amperes, correct?

    ((0*128)+0-2048) / 20.48 = -100 OK
    ((24*128)+127-2048) / 20.48 = 56 ??
    /Henrik.
    Henrik and others thanks for your help.

    Sorry yes the maximum value for $18 is actually $17 so thats puts the range covered within -100 to + 50.

    That code looks really helpful, and is easily accurate enough, yes the answer is being displayed via a serial lcd device that's not a problem.

    The second issue with the seperate lower formula is

    Also for a second formula involving BD [2] & BD [3] I need to

    (Multiply the right hand digit of 1st hex number by 128, add result to 2nd number)

    I'm stuck on extracting a value for the right hand digit of the hex number?
    As an aside it may be my formula for BD[2] & BD [3] is incorrect I suspect it should resolve to a number between 0-100% at it represents battery state of charge.
    My captured range of values for BD[2] is $21 -$34 and for BD[3] it's again $00-$7F

    Ignoring the first digit of BD [2] gives a range of values that seems to work
    Last edited by retepsnikrep; - 7th July 2010 at 07:49. Reason: Extra info

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