Rescaling of values in PBP.


Results 1 to 8 of 8

Threaded View

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


    Did you find this post helpful? Yes | No

    Talking PBP and Math ...

    Quote Originally Posted by aratti View Post
    Tray (Value * 0.313)+165

    a) (0*0.313)+165 = 165
    b) (255*0.313)+165 = 244.8

    Since you don't need high accuracy it should work.

    Al.
    Hi,

    With PbP ... I'd rather try :

    Duty = ( Value * 5 /16 ) + 165



    But it's just me ...

    might better be PWM = (3.175 * Value ) - 523.875

    OR PWM = ( 127 /40 * Value ) - ( 4191 / 8 )

    PWM = (( 127 * value / 5 ) - 4191) >> 3

    ...

    Alain
    Last edited by Acetronics2; - 27th December 2008 at 20:08.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP, ASM and LST files
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2010, 13:43
  3. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  4. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30

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