The counter element is used to implement a periodic software counter.
The following properties can be changed for the counter element:
The name of the element.
The initial counter value. Must be an integer.
The value at which the counter will rollover and reset.
This behaves similar to a modulo, where the counter will never actually reach this value. After the counter is incremented or decremented, if the new value is equal to the rollover value, the counter will be reset and the
counter reset trigger will be executed.
Reset to Initial Value
When enabled, the counter will reset to the initial value when a rollover occurs. Otherwise, the counter will reset to 0.
When enabled, the counter will rollover. If disabled, the counter will continue to increment up to its maximum 32 bit signed range.
The following triggers are available to execute events from within the counter element:
Execute an event when the source element connected to the counter triggers.
Execute an event when the counter resets.
Execute an event when the counter is incremented. This will pass the current value of the counter.
Execute an event when the counter is decremented. This will pass the current value of the counter.
Execute an event when the current counter value is retrieved. This will pass the current value of the counter.
The following abilities are available for the counter element when its source element triggers:
Trigger the element(s) that follow the counter element.
Increment the current value of the counter by one.
Decrement the current value of the counter by one.
Retrieve the current value of the counter.
Atmosphere includes a selection of resources for users of all levels that demonstrate using the counter element.
To view the counter element used within a project, click the demo’s name to open the project in Atmosphere and see how the element is set up.
|Counter Clock ESP32 Demo||ESP32||The counter element is used within this demo project by counting seconds and minutes based off a 200ms interval.|
|Counter Element Arduino Demo||Arduino Mega||The counter element is used within this demo project by incrementing and decrementing values and printing them on the debug console.|