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 Pack
FREE
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
|
ReadState
|
Reads the button state as 0 for released or 1 for pressed Performs debounce if required
|
- BYTE
|
Return
|
|
WaitUntilHigh
|
Waits until the switch is in state 'high' The interpretation of 'high' depends on the polarity
|
- VOID
|
Return
|
|
WaitUntilLow
|
Waits until the switch is in state 'low' The interpretation of 'high' depends on the polarity
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Connections
|
|
Connection
|
The chip pin to which the switch connects.
|
|
Polarity
|
Set the polarity of states sent to the chip pin. 'Active High' -> Pressed = On, Released = Off 'Active Low' -> Pressed = Off, Released = On
|
|
Debounce (ms)
|
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.
|
|
Simulations
|
|
Moving part
|
Sets a panel object or group to be the moving part of the switch model. Make sure that the object is in the 'Off' position at the time of linking.
|
|
Pivot object
|
When using the 'Rotary' switch type, the 'Moving part' will rotate about the object set here. The moving part will rotate around its own axes if this property is left 'Unconnected'.
|
|
Type
|
Sets whether the motion of the 'Moving part' will be 'Push/Slide' (linear motion) or 'Rotary' (e.g. toggle switches).
|
|
Operation
|
'Latching' = click to turn on, click again to turn off. 'Momentary' = click to turn on, release to turn off.
|
|
Axis
|
For 'Push/Slide' switches, the axis that the 'Moving part' will move along. For 'Rotary' switches, the axis around which 'Moving part' will rotate.
|
|
Movement
|
For 'Push/Slide' switches, the distance (in local units) to move along the axis. For 'Rotary' switches, the angle (in degrees) to rotate around the axis.
|
|
Notify on change
|
When enabled, a 'System.User' event will be sent for each change of switch state. The event is sent to the 'parent' component in which this 'Swict base' instance is used.
|