This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Map
From CANNY Wiki
Appearance | |
---|---|
Symbol | |
MAP | |
Group | |
Converters | |
Inputs | |
Value: | Integer |
Value from: | Integer |
Value to: | Integer |
Result from: | Integer |
Result to: | Integer |
Outputs | |
Result: | Integer |
Version CANNY Lab | |
from 1.18 |
Re-maps a number from one range to another using linear interpolation method.
For the mathematically inclined, here's the whole formula:
The Map function block uses integer math so will not generate fractions. Fractional remainders are truncated, and are not rounded or averaged.
If the denominator of a fraction in above formula is zero, the Result is equal to 65535
Does not constrain values to within the range, because out-of-range values are sometimes intended and useful.
Features
You can use the Map function block to map an analog input value, which ranges from 0 to 4095 to a voltage value, which ranges from 0 - 5000 millivolts.