====== Iscalef() ====== ''Iscalef()'' converts a floating-point input value to the specified floating-point range. {{:en-us_commands:reference:iscalef.svg?900|Iscalef command operation flow}} ''float Iscalef(float x, float in_min, float in_max, float out_min, float out_max)'' ===== Commands ===== ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ''Iscalef(x, in_min, in_max, out_min, out_max)'' | ''float x'' — Input value to convert\\ ''float in_min''\\ ''float in_max''\\ ''float out_min''\\ ''float out_max'' | ''float'' | Converts a floating-point input value to the specified floating-point range. | ===== Example ===== void setup() { Serial.begin(115200); } void loop() { const float raw = (float)analogRead(A0); // Read the raw analog value of the specified channel. const float pressureBar = Iscalef(raw, 0.0F, 32767.0F, 0.0F, 10.0F); // Map a floating-point input to the specified floating-point range. if (pressureBar >= 0.0F && pressureBar <= 10.0F) Serial.println(pressureBar, 2); delay(100); } ===== Precautions ===== * All arguments and the return value of ''Iscale()'' have a range of ''-2147483648~2147483647''. * Out-of-range inputs are clamped to the nearest output endpoint. * Both commands perform only linear range conversion. They do not replace sensor calibration or electrical protection. ===== Built-in Commands in the Same Category ===== * [[:en-us_commands:reference:iscale|Iscale() View detailed description]] [[:en-us_commands:builtin|← Built-in Command List]]