Difference between revisions of "Component: Switch base (Inputs)"

From Flowcode Help
Jump to navigationJump to search
(XML import of component lists)
(XML import of component lists)
Line 25: Line 25:
 
{| class="wikitable" width="50%"
 
{| class="wikitable" width="50%"
 
|+|-
 
|+|-
 +
|[[File:Component Icon c6c91999_1fe0_414e_b6aa_0a7ddc9a6417.png|Image]] Toggle Metal PCB
 +
|Miniature toggle switch with metal tang.  Pins for PCB mounting.
 +
|-
 
|[[File:Component Icon 6f2c4205_6a87_46ba_a8b4_8c869e144fcd.png|Image]] Microswitch V3 Roller
 
|[[File:Component Icon 6f2c4205_6a87_46ba_a8b4_8c869e144fcd.png|Image]] Microswitch V3 Roller
 
|Industry standard V3 size microswitch fitter with a roller arm.
 
|Industry standard V3 size microswitch fitter with a roller arm.
|-
 
|[[File:Component Icon c6c91999_1fe0_414e_b6aa_0a7ddc9a6417.png|Image]] Toggle Metal PCB
 
|Miniature toggle switch with metal tang.  Pins for PCB mounting.
 
 
|-
 
|-
 
|[[File:Component Icon 26732594_ad79_472f_80ff_95d365b3b252.png|Image]] Push Click PCB
 
|[[File:Component Icon 26732594_ad79_472f_80ff_95d365b3b252.png|Image]] Push Click PCB

Revision as of 15:38, 9 August 2013


Author Matrix Ltd
Version 1.0
Category Inputs


Image Switch base component

A simple single-pin switch


This component can be used as a base to create child components

The following components all inherit the traits of Switch base:

-
Image Toggle Metal PCB Miniature toggle switch with metal tang. Pins for PCB mounting.
Image Microswitch V3 Roller Industry standard V3 size microswitch fitter with a roller arm.
Image Push Click PCB Surface mount click switch, standard 6mm square size.
Image Rocker Neon Rocker switch with indicator lamp and properties for changing the colours of each part.
Image Dashboard Switch Simple latching slide switch using the default Matrix dashboard theme.
Image Slide PCB Submin Subminiature slide switch with black tang, PCB mount.
Image Push Round Panel Large round push switchwith chrome bezel for panel mounting.
Image Dashboard Button Simple momentary push-button using the Matrix dashboard theme.
Image Toggle Metal Panel Miniature toggle switch with metal tamg - solder lugs and nut for panel mounting.
Image Basic Switch Simple push button switch with LED indicator.

Momentary or latching action can be chosen in the properties.

Examples

No additional examples


Downloadable macro reference

ReadState

Reads the button state as 0 for released or 1 for pressed

Performs debounce if required

Parameters

This macro has no parameters


Return value

BYTE


WaitUntilHigh

Waits until the switch is in state 'high'

The interpretation of 'high' depends on the polarity

Parameters

This macro has no parameters


Return value

This call does not return a value


WaitUntilLow

Waits until the switch is in state 'low'

The interpretation of 'high' depends on the polarity

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Connection

This property is of type Single digital pin and can be referenced with the variable name pin.

The chip pin to which the switch connects.

Polarity

This property is of type Fixed list of ints and can be referenced with the variable name 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)

This property is of type Signed integer and can be referenced with the variable name debounce.

Sets the time in milliseconds to allow a pin change to settle into a stable state.

Moving part

This property is of type Panel object and can be referenced with the variable name target.

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

This property is of type Panel object and can be referenced with the variable name pivot.

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

This property is of type Fixed list of ints and can be referenced with the variable name movetype.

Sets whether the motion of the 'Moving part' will be 'Push/Slide' (linear motion) or

'Rotary' (e.g. toggle switches).

Operation

This property is of type Fixed list of ints and can be referenced with the variable name operation.

'Latching' = click to trun on, click again to turn off.

'Momentary' = click to turn on, release to turn off.

Axis

This property is of type Fixed list of ints and can be referenced with the variable name 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

This property is of type Floating point and can be referenced with the variable name move.

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

This property is of type True or false and can be referenced with the variable name notify.

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.