Back to Index
Two-point scaling with output clamping to the target range.
SCALE_2PT_CLAMP(x, x1, x2, y1, y2, &y);
// Example pattern from analog_macros.ems SCALE_2PT_CLAMP(ain(1), 32, 31850, 0, 10000, mv);