Help with math for progress bar.
Posted: 16 Jan 2019, 19:26
I'm needing to do some math for a progress bar but am unable to wrap my head around it. I'm reading the input of a temperature sensor but the input is high numbers for low temps and low numbers for high temps.
For instance,
So I need to convert these numbers for a progress bar that will reed 0c to 100c. (or get it in the ballpark)
Who here is good at math?
Thanks
Edit:
With Arduino, there is a "Map" function for changing the input to match the expected output.
Is there a similar function in AHK?
For instance,
Code: Select all
Temp of 34c sensor returns 380.
Temp of 4c sensor returns 660
Who here is good at math?
Thanks
Edit:
With Arduino, there is a "Map" function for changing the input to match the expected output.
Code: Select all
value = map(value, 0, 1023, 0, 255);