Equation

Can anybody help me to resolve a formula for this equation.

input Value | Output
0 60
1 59
2 58
.....
.....

253 2
254 1
255 0

Thank you guys

Doesn't make sense.
61 output values (0-60) spread out over 256 input values (0-255) can't have an exact step value of 1.

outputValue = map(inputValue, 0, 255, 60, 0); // might do what you want

Leo..

You're right Wawa. I didn't express correctly. But you got the idea of what I needed.

Thanks

It would make sense if the output is floating point. Then use

float outputValue = (255 - inputValue)*60./255.;

jucasan:
Can anybody help me to resolve a formula for this equation.

input Value | Output
0 60
1 59
2 58
.....
.....

253 2
254 1
255 0

Thank you guys

Sure.... Y = 60 - input for cases when input is 0 to 60

And Y = 255 - input for cases when input is 253 to 255.

And Y is undefined when input is 61 to 252.

Essentially a non-linear system.