Data Type Conversion Element

The data type conversion element is used to manually convert embedded data values fed into it from one data type to another. Most Atmosphere elements will convert data types implicitly, but there are some instances where you may need to manually specify the type, such as converting a floating temperature reading to an integer before displaying its value.

The data type conversion element is located in the Element Toolbox within Studio’s Embedded tab.

Properties

The following properties can be changed for the data type conversion element:

Name

The name of the element.

Output Type

The output type to convert the input value to. This element includes the following data type options:

  • Void
  • Character
  • Boolean
  • Integer
  • Unsigned Integer
  • Floating Point (32-bit)
  • Double Floating Point (64-bit)
  • Raw Binary Data
  • String

Triggers

The following triggers are available to execute events from within the data type conversion element:

Triggered

Execute an event when the source element connected to the data type conversion triggers.

Converted

Execute an event when the conversion completes. The converted value will be passed to following element(s).

Abilities

The following abilities are available for the data type conversion element when its source element triggers:

Trigger

Trigger the element(s) that follow the data type conversion element.

Convert

Convert the data type of the input value to the specified output type.

Element Resources

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

Demo Projects

To view the data type conversion 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
Data Type Conversion Arduino Demo Arduino Mega The data type conversion element is used within this demo project by converting the temperature value from float to integer and printing both the values on the debug console.
Data Type Conversion ESP32 Demo HUZZAH32 The data type conversion element is used within this demo project by reading the integer values from the app’s slider using BLE and converting them into characters from the ASCII table, then printing them on the debug console.
Data Type Conversion Rapid IoT Demo Rapid IoT The data type conversion element is used within this demo project by converting pressure data read from the board from an interger value to a floating point value.