map():
outputValue = map(sensorValue, 0, 1023, 0, 255);
- Output is assigned to equal the scaled value from the potentiometer.
map()
accepts five arguments:
- The value to be mapped,
- the low range and high values of the input data, and
- the low and high values for that data to be remapped to.
- In this case, the sensor data is mapped down from its original range of 0 to 1023 to 0 to 255.
No comments:
Post a Comment