Reference for Wiring 1.0 (ALPHA) 0017+. If you have a previous version, use the reference included with your software.
If you see any errors or have any comments, let us know.
Name
map()
Examples
int value;
int m;
void setup() {
Serial.begin(9600);
}
void loop() {
value = analogRead(0);
m = (int)map(value, 0, 1023, 0, 255); // converts a number in the range
Serial.println(m, BYTE); // 0-1023 to a number in the range 0-255
delay(100);
}
Description
out-of-range values are often intentional and useful.