Map() In python

Hi

I have experience coding arduino and js and use the map function pretty regularly- I just tried it in a callback and am getting an error. From looking into it, it seems like the map function in python is not for mapping ranges. Is that correct? For now I’m exporting the value I want to map to a table and using a math chop but it would be nice to do it in code if possible

Hi there,

Check out the tdu module. There is a function called ‘remap’. I think that’s the one you’re looking for.

tdu.remap(input, fromMin, fromMax, toMin, toMax)

Cheers,
tim

awesome!!! that is exactly what I needed.