Wednesday, April 1, 2020

Function map()??

map():
outputValue = map(sensorValue, 0, 1023, 0, 255);
  • Output is assigned to equal the scaled value from the potentiometer. 
  • map() accepts five arguments: 
  1. The value to be mapped, 
  2. the low range and high values of the input data, and 
  3. the low and high values for that data to be remapped to. 
  4. 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