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 ?![]()
Bookmarks