Comparison Element

The comparison element is used to compare an input value fed into it to a pre-defined constant target value. All comparison triggers will pass the input value along to the next element. This allows you to chain multiple comparison elements together. See the “Comparison Element Chain” demo for an example.

The comparison element is located in the Element Toolbox within Studio’s Embedded tab.

Properties

The following properties can be changed for the comparison element:

Name

The name of the element.

Condition

The logical condition used to compare the input value and target value. This element includes the following comparison options:

  • Less Than
  • Less Than or Equal
  • Greater Than
  • Greater Than or Equal
  • Equal

Target Value

The pre-defined constant value to compare to the input value.

Triggers

The following triggers are available to execute events from within the comparison element:

Triggered

Execute an event when the source element connected to the comparison triggers.

Condition True

Execute an event when the specified condition is true. The input value will be passed along with this trigger.

Condition False

Execute an event when the specified condition is false. The input value will be passed along with this trigger.

Invalid Input

Execute an event when the provided input value is invalid. This typically will refer to a value that was non-numeric.

Abilities

The following abilities are available for the comparison element when its source element triggers:

Trigger

Trigger the element(s) that follow the comparison element.

Evaluate

Perform a comparison between the input value and the target value using the specified condition.

Element Resources

Atmosphere includes a selection of resources for users of all levels that demonstrate using the comparison element.

Demo Projects

To view the comparison element used within a project, click the demo’s name to open the project in Atmosphere and see how the element is set up.

Name Hardware Description
Comparison Element Chain Demo MAX32630 Feather The comparison element is used within this advanced demo project by chaining of comparison elements to create a “Logical And.” This demo lights the blue LED on the MAX32630 Feather board whenever the app’s slider value is between 10 and 20.
Comparison ESP32 Demo HUZZAH32 The comparison element is used within this demo project by taking values from the app’s slider using BLE, comparing those values, then printing them on the debug console.
Comparison Rapid IoT Demo Rapid IoT The comparison element is used within this demo project by comparing the board’s light sensor readings and printing them on the debug console.