arduino map voltage to scale 1 to 5 code example
Example: 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);