Global Timers ------------- A global timer ends an infinite loop when 5 seconds have passed. .. image:: global_timers.svg :align: center .. tab-set:: .. tab-item:: Python .. literalinclude:: ../../../../examples/state_machines/global_timers.py :language: python :start-at: from bpod_core. .. tab-item:: JSON .. code-block:: json { "states": { "StartGlobalTimer": { "timer": 0.25, "transitions": { "Tup": "Port1Light" }, "actions": { "GlobalTimerTrig": 0 } }, "Port1Light": { "timer": 0.25, "transitions": { "Tup": "Port3Light", "GlobalTimer0_End": ">exit" }, "actions": { "PWM1": 255 } }, "Port3Light": { "timer": 0.25, "transitions": { "Tup": "Port1Light", "GlobalTimer0_End": ">exit" }, "actions": { "PWM3": 255 } } }, "global_timers": { "0": { "duration": 5.0 } } } .. tab-item:: YAML .. code-block:: yaml states: StartGlobalTimer: timer: 0.25 transitions: Tup: Port1Light actions: GlobalTimerTrig: 0 Port1Light: timer: 0.25 transitions: Tup: Port3Light GlobalTimer0_End: '>exit' actions: PWM1: 255 Port3Light: timer: 0.25 transitions: Tup: Port1Light GlobalTimer0_End: '>exit' actions: PWM3: 255 global_timers: 0: duration: 5.0