epsilonrt / piduino

Arduino API on Pi boards, the best of both worlds !
https://epsilonrt.fr/2019/01/piduino/
GNU Lesser General Public License v3.0
29 stars 7 forks source link

map function not working #8

Closed ghost closed 5 years ago

ghost commented 5 years ago

I included but map is not working. here is the error.

picar.c: In function ‘void loop()’: picar.c:87:32: error: ‘map’ was not declared in this scope sp = map(temp, 0, 100, 0, 255); ^ picar.c:87:32: note: suggested alternative: In file included from /usr/include/c++/6/map:61:0, from /usr/include/piduino/gpio.h:23, from /usr/include/piduino/arduino/Arduino.h:83, from /usr/include/piduino/arduino/Piduino.h:20, from picar.c:1: /usr/include/c++/6/bits/stl_map.h:96:11: note: ‘std::map’ class map ^~~

epsilonrt commented 5 years ago

Yep ! I forgot this function, it will be added in the next version. In the meantime you can copy the code of the function to the beginning of your program: https://www.arduino.cc/reference/en/language/functions/math/map/

epsilonrt commented 5 years ago

Fixes by v0.3.44