gatheround
Well-known member
After spending a night trying to debug an issue I was having, I narrowed it down the map() on my Teensy returning an incorrect value.
map(1,0, 1, 100, 0); // returns 51 on teensy, 0 on arduino.
I'd expect this to return 0, but the function returns 51 on my Teensy 3.2, Teensy LC and Teensy 3.0. I tested it with an Arduino Uno and this command returns 0 as expected.
Interestingly, the Teensy works correctly if I do some fudgery:
(int)map((float)1,0,1,100,0); // returns 0.
I am using arduino 1.8.13, teensyduino 1.53
map(1,0, 1, 100, 0); // returns 51 on teensy, 0 on arduino.
I'd expect this to return 0, but the function returns 51 on my Teensy 3.2, Teensy LC and Teensy 3.0. I tested it with an Arduino Uno and this command returns 0 as expected.
Interestingly, the Teensy works correctly if I do some fudgery:
(int)map((float)1,0,1,100,0); // returns 0.
I am using arduino 1.8.13, teensyduino 1.53