- According to its reference: Processing.org/reference/map_.html
- Function map() returns a
floatdatatype value. - So we need to convert it to
intif we try to assign it to anintvariable. - There are many ways to do it though. Some examples:
m = (int) map(n, 0, 40, 1, 14);m = int( map(n, 0, 40, 1, 14) );m = floor( map(n, 0, 40, 1, 14) );m = round( map(n, 0, 40, 1, 14) );