Digital TOGGLE

Description

This object is being used to form a 'Digital TOGGLE' between two message in an app.


App Builder Object


Source Code

function execute() { switch (trigger) { case 0: context.state = true; break; case 1: context.state = false; break; case 2: { context.state = !context.state; break; } default: break; } return [context.state, !context.state]; }

Truth Table

= empty / no message sent to

Set

Reset

Toggle

Out

Out inverted

Set

Reset

Toggle

Out

Out inverted

Trigger

1

0

Trigger

0

1

Trigger

1

0

Trigger

0

1


In Ports

Position

Name

Message Type

Description

Position

Name

Message Type

Description

1

Set

Trigger

This port is being used to send and hold a digital message (true) out of the out port (and false for the out inverted port). See truth table.

2

Reset

Trigger

This port is being used to send and hold a digital message (false) out of the out port (and true for the out inverted port). See truth table.

3

Toggle

Trigger

This port is being used to toggle between the two possible digital states. See truth table.


Out Ports

Position

Name

Message Type

Description

Position

Name

Message Type

Description

1

Out

Digital

This port is being used to send out the digital value from the ‘Digital TOGGLE' object when it executes.

2

Out inverted

Digital

This port is being used to send out the inverted digital value from the 'Digital TOGGLE' object when it executes.


Properties

Name

Description

Name

Description

Object Name

The name of the object on the canvas.

Show Code View

The switch to turn on code view for the Code Object.

Duplicate code into custom Code Object