I explain myself in a better way, I am doing a window regulated by temperature, I wish that for each 5 degrees of temperature it is a quantity of degrees of the motor.
An example.
If the ambient temperature of the place is 25 degrees the window (motor) will be at 22.5 degrees. If the temperature goes up the window will open and if the temperature drops the window closes.
if you could write the code it would be great. and thanks in advance for reading my post