KEY TAKE AWAY POINTS:
Map from a rang (low, high) to another range (low', high')
The mapping result are usually decimals, remember to round up for full integer result if needed
Zoom in to the "active range" to map, so to improve output "sensitivity"
Usually used for sensor data handling
START A BIT > Knowledge Base > This page
long map(long x, long in_min, long in_max, long out_min, long out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}