Processing map function

Hello all. Not entirely sure where to post this but I guess this area will suffice. Please correct me if I am wrong. Anyway, I thought I would mention that I have found the map() function in Processing's core library to be quite handy for Arduino and other mC platforms. You basically map a value from its actual range to a desired range. Here is the code (Processing is under GPL):

     float map(float value, float istart, float istop, float ostart, float ostop) {
         return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
     }

istart and istop is the actual range of 'value' and ostart and ostop is the desired range. You can read more at this post: NameBright - Coming Soon.

:slight_smile:

There have been a few requests for this already. It will be in Arduino 0011.