Rotary Switch

The rotary switch component is a scripted component that implements a virtual rotary switch. You can toggle the switch between a specified number of positions and angles. The rotary switch I/O contains a single UInt8 position signal, which stores the current position of the switch.

The current position of the switch is a value in the range [0, positions - 1] where positions is the number of discrete positions. If you click on the switch when you are in navigate mode, the position is incremented:

position = min(position + 1, positions - 1)

If you press the shift key and click on the switch when you are in navigate mode, the posiiton is decremented:

position = max(position - 1, 0)

You can also specify a stepAngle which rotates the entity of the switch (about an axis and around an anchor point) whenever the position is updated.

Properties

The rotary switch component properties that are accessible through the inspector.

Axis

The axis about which the switch entity should be rotated.

Anchor

The point about which the switch entity should be rotated.

Step Angle

The angle to rotate the switch entity per position update.

Positions

The number of discrete positions of the switch.

Initial Position

The initial position of the switch (represented by the mesh) in the range [0, positions - 1].

IO

The IO signals provided by the rotary switch.

position

The current position of the switch.