Back Operator ------------- In this example, when the ``>back`` operator is triggered by ``Port3In`` in the state `WaitForExit`, the state machine returns to the state that previously transitioned into `WaitForExit` - either `FlashPort1` or `FlashPort2`. .. image:: back_operator.svg :align: center .. tab-set:: .. tab-item:: Python .. literalinclude:: ../../../../examples/back_operator.py :language: python :start-at: from bpod_core. .. tab-item:: JSON .. code-block:: json { "states": { "WaitForChoice": { "transitions": { "Port1_High": "FlashPort1", "Port2_High": "FlashPort2" } }, "FlashPort1": { "timer": 0.5, "transitions": { "Tup": "WaitForExit" }, "actions": { "PWM1": 255 } }, "FlashPort2": { "timer": 0.5, "transitions": { "Tup": "WaitForExit" }, "actions": { "PWM2": 255 } }, "WaitForExit": { "transitions": { "Port1_High": ">exit", "Port2_High": ">exit", "Port3_High": ">back" } } } } .. tab-item:: YAML .. code-block:: yaml states: WaitForChoice: transitions: Port1_High: FlashPort1 Port2_High: FlashPort2 FlashPort1: timer: 0.5 transitions: Tup: WaitForExit actions: PWM1: 255 FlashPort2: timer: 0.5 transitions: Tup: WaitForExit actions: PWM2: 255 WaitForExit: transitions: Port1_High: '>exit' Port2_High: '>exit' Port3_High: '>back'