Transitions
Overview
Example of transitions in the Blink Program.
Transitions connect states. After the code in the state has been executed a transition describes how we move on to the next state. The then and delay transition are available for all types of components, while the if, ifelse and cond transitions are only available for user input and sensor components. The later three depend on the input generated by the component.
Available Transitions
then
then example
A then transition immediatly moves on to the next state.
delay
delay transition example
A delay transition waits for a specified number of milliseconds before moving to the next state.
if
if transition example
An if transition will only move on to the next state if a condition is met, if not it will remain in the current state. This is useful for sensors.
if else
If Else transition example
An if else transition will only move on to the next state if a condition is met, if not it will move on to a different state. This is useful for user input components.
cond
Cond transition example
A cond transition will move to different states depending on the input. This makes sense for sensors with analog output as we can define different action depending on the resulting value.