Difference between revisions of "Component: Map Function (Calculation)"
From Flowcode Help
Jump to navigationJump to search(4 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Map-Function.fcfx FC_Comp_Source_Map-Function.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Map-Function.fcfx FC_Comp_Source_Map-Function.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 37: | Line 37: | ||
==Examples== | ==Examples== | ||
+ | A simple example showing how to take a value from an adc input with the range 0-255 and mapping this to a predetermined range of 50-150 to drive a PWM output. | ||
− | + | {{Fcfile|MappingADCtoPWM.fcfx|Mapping ADC to PWM}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Macro reference== | ==Macro reference== | ||
Line 319: | Line 305: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 10:28, 4 March 2024
Author | medelec35 |
Version | 2.0 |
Category | Calculation |
Contents
Map Function component
The map function is intended to change one range of values into another range of values. For example. Output from a temperature sensor is in centigrade. you can map it to give the result in Fahrenheit. To do that set: InMin to 0, InMax 100, OutMin to 32 & OutMax to 212
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Map-Function.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Map-Function.fcfx
Detailed description
No detailed description exists yet for this component
Examples
A simple example showing how to take a value from an adc input with the range 0-255 and mapping this to a predetermined range of 50-150 to drive a PWM output.
Macro reference
MapByte
MapFloat
MapInt
MapLong
MapUInt
MapUlong
Property reference
![]() |
Properties |