Picaxe equivalent of Arduino Map() function?
Arduino has a Map() function that allows you to adjust adc input so that it reads the full scale, say 0 to 255 or 0 to 1023. As an example say you have a sensor that's output range is from 0.25V to 4.5V. Well, if inputted directly to say readadc10, you will only be working with a range of values something like 35 to 996 (estimated), instead of 0 to 1023. With the Map() function, it WILL output 0 to 1023! Does Picaxe have a similar function? Or is there a formula you must use?
Arduino has a Map() function that allows you to adjust adc input so that it reads the full scale, say 0 to 255 or 0 to 1023. As an example say you have a sensor that's output range is from 0.25V to 4.5V. Well, if inputted directly to say readadc10, you will only be working with a range of values something like 35 to 996 (estimated), instead of 0 to 1023. With the Map() function, it WILL output 0 to 1023! Does Picaxe have a similar function? Or is there a formula you must use?
Last edited: