Rescaling of values in PBP.


Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80

    Default Rescaling of values in PBP.

    I am working on a project where I first do a calibrating sequence where I get the max and min values of an in-signal, typically it can be (during my tests) that min is 165 and max is 245.

    Now I want to use this signal to a PWM output, therefore I want to make a scale so that (in the test example) 165 is 0, and 245 is 254.

    How do I do this ? I guess there is some mathematical way, if it was fixed values I might have considered a lookup table, even if its a bit of an overkill, but now the values can be different from time to time.

    ..I can also say that I don't need much of a precision in the conversation.

    I did a similar thing before, but then the in-signal was resistive, so I could use the scale parameter of the pot command, very easy. ..Now its not, so now I don't know how to solve it.

    Please help ?
    Last edited by Glenn; - 27th December 2008 at 18:28.

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