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
|
2014-06-05 18:29:43 -07:00
|
|
|
long fastMap(int x, int in_min, int in_max, int out_min, int out_max)
|
2013-09-23 05:23:34 -07:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|