Answers for "arduino map function"

12

map arduino

Syntax
map(value, fromLow, fromHigh, toLow, toHigh)

Parameters
value: the number to map.
fromLow: the lower bound of the value’s current range.
fromHigh: the upper bound of the value’s current range.
toLow: the lower bound of the value’s target range.
toHigh: the upper bound of the value’s target range.
  
Example:
map(val, 0, 255, 0, 1023);
Posted by: Guest on May-18-2020
1

arduino map function

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;
}
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language