Average Logic Element
The average logic element is used to place values into a buffer that can be averaged.
The average logic element is located in the Element Toolbox within Studio’s Application tab.
Properties
The following properties can be changed for the average logic element:
Name
The name of the element.
Sample Size
The number of values within the buffer to average, using the most recent values that entered the buffer.
Triggers
The following triggers are available to execute events from within the average logic element:
Triggered
Execute an event when the source element connected to the average logic triggers.
Averaged
Execute an event when the buffer values are averaged.
Pushed
Execute an event when the source element sends a value to the end of the buffer.
Cleared
Execute an event when the buffer is cleared.
Sample Size Set
Execute an event when the average sample size is set.
Abilities
The following abilities are available for the average logic element when its source element triggers:
Trigger
Trigger the element(s) that follow the average logic element.
Push
Append the provided values to the end of the buffer.
Clear
Clear all values within the buffer.
Average Values
Average all values within the buffer.
Set Sample Size
Set the number of values to average.
Demo Projects
To view the Average 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 |
---|---|---|
Buffer/Average Element Demo | NXP Rapid IoT | Every second, the Rapid IoT kit sends the temperature via BLE. The app will average every 6 values and send the result to a buffer. When you press the button, the latest average is popped from the buffer and printed. |