Definition: scale(x, inMin, inMax, outMin, outMax) — Allowed: numeric expressions; Not allowed: string args.
Scales and clamps a value from one range into another. Input is clamped to inMin..inMax before scaling.
scale(x, inMin, inMax, outMin, outMax);
mv = scale(ain(1), 32, 31850, 0, 10000);
publish("ai/pressure", "mv", mv);