MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / map

Method map

libraries/moduloMap/moduloMap.h:50–57  ·  view source on GitHub ↗

AVR 36 us

Source from the content-addressed store, hash-verified

48
49 // AVR 36 us
50 float map(float value)
51 {
52 // add next line if most values are in range.
53 // if ((_minimum <= value) && (value < _maximum)) return value;
54 float mm = fmod((value - _minimum), _range) + _minimum;
55 if (mm < _minimum) mm += _range; // catch rounding errors
56 return mm;
57 }
58
59 // Think of it as how many rotations must a hoist make to free a rope of given length.
60 // Or how many rotations a cylinder has to make to roll up a rope of given length.

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36