PbPro Maths Help


Closed Thread
Results 1 to 15 of 15

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    retepsnikrep , Why not just use the "*/" command? The variable "Amps" is a word so just multiply it by the fraction of 84 to 92 %. The "*/" command will give you the middle 16 bits of the 32 bit result. Then just put the result back into bytes.... Thats what I would do.....

    Dave Purola,
    N8NTA

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Thanks for that.

    How about this?

    Anyway, a reverse of my code? Does it make sense.

    Code:
    Amps = Amps * 512
    Amps DIV32 2500
    
    if AmpSign == 45 then '-
    Amps = 0 - Amps
    else
    ? not sure here
    endif
    
    Amps = Amps + 2048
    Byte2 = Amps & &7f 'split of HEXBYTE2
    Amps = Amps >> 7 'Div by 128
    Byte1 = Amps & 0x1f '

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