2013-09-23 05:23:34 -07:00
|
|
|
|
2014-05-08 06:01:36 -07:00
|
|
|
//Replace the standard arduino map() function to use the div function instead
|
2013-09-23 05:23:34 -07:00
|
|
|
long fastMap(long x, long in_min, long in_max, long out_min, long out_max)
|
|
|
|
{
|
2014-05-08 06:01:36 -07:00
|
|
|
return div( ((x - in_min) * (out_max - out_min)) , ((in_max - in_min) + out_min) ).quot;
|
2013-09-23 05:23:34 -07:00
|
|
|
}
|
|
|
|
|