Component: Switch Template (Switch): Difference between revisions
Appearance
No edit summary |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 62: | Line 62: | ||
===ReadState=== | ===ReadState=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadState''' | ||
|- | |- | ||
| colspan="2" | Reads the button state as 0 for released or 1 for pressed Performs debounce if required | | colspan="2" | Reads the button state as 0 for released or 1 for pressed Performs debounce if required | ||
| Line 76: | Line 76: | ||
===WaitUntilHigh=== | ===WaitUntilHigh=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WaitUntilHigh''' | ||
|- | |- | ||
| colspan="2" | Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity | | colspan="2" | Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity | ||
| Line 90: | Line 90: | ||
===WaitUntilLow=== | ===WaitUntilLow=== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WaitUntilLow''' | ||
|- | |- | ||
| colspan="2" | Waits until the switch is in state 'low' The interpretation of 'high' depends on the polarity | | colspan="2" | Waits until the switch is in state 'low' The interpretation of 'high' depends on the polarity | ||
| Line 105: | Line 105: | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Connections | ||
|- | |- | ||
|- | |- | ||
| Line 130: | Line 130: | ||
| colspan="2" | Sets the time in milliseconds to allow a pin change to settle into a stable state. NB) Debouncing is only used when reading the button state using the component macros. Chip pins are NOT debounced. | | colspan="2" | Sets the time in milliseconds to allow a pin change to settle into a stable state. NB) Debouncing is only used when reading the button state using the component macros. Chip pins are NOT debounced. | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix Ltd |
| Version | 1.1 |
| Category | Switch |
Switch Template component
Base single pin switch with no graphical interface Suitable for building your own switches with custom graphics. If the parent component has properties 'pin', 'polarity', 'debounce' and/or 'operation', they will automatically be forwarded to the base component.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Switch.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Switch.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ReadState
| ReadState | |
| Reads the button state as 0 for released or 1 for pressed Performs debounce if required | |
| Return | |
WaitUntilHigh
| WaitUntilHigh | |
| Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity | |
| Return | |
WaitUntilLow
| WaitUntilLow | |
| Waits until the switch is in state 'low' The interpretation of 'high' depends on the polarity | |
| Return | |