Back to Index

Maps and clamps x from inLo..inHi to outLo..outHi.

Signature

MAP_CLAMP(x, inLo, inHi, outLo, outHi, &y);

Example

// Example pattern from analog_macros.ems
MAP_CLAMP(ain(1), 200, 900, 0, 100, pct);