Back to Index

Two-point scaling with output clamping to the target range.

Signature

SCALE_2PT_CLAMP(x, x1, x2, y1, y2, &y);

Example

// Example pattern from analog_macros.ems
SCALE_2PT_CLAMP(ain(1), 32, 31850, 0, 10000, mv);