bpod_core.bpod.FSMThread

class bpod_core.bpod.FSMThread

Bases: Thread

A thread for managing the execution of a finite state machine on the Bpod.

__init__(serial, fsm_index, confirm_fsm, cycle_period, softcode_handler, state_transitions, use_back_op) None

Initialize the FSMThread.

Parameters:
  • serial (ExtendedSerial) – The serial connection to the Bpod device.

  • fsm_index (int) – The index of the FSM being managed.

  • confirm_fsm (bool) – Whether to confirm the FSM with the Bpod device.

  • cycle_period (int) – The cycle period of the Bpod device in microseconds.

  • softcode_handler (Callable) – A handler function for processing softcodes.

  • state_transitions (np.ndarray) – The state transition matrix

  • use_back_op (bool) – Whether the state machine makes use of the >back operator

Return type:

None

run() None

Execute the FSMThread.

Return type:

None

stop()