BpodSystem_EmulatorMode

BpodSystem.EmulatorMode

Description

When no Bpod device is found, the user can launch the Bpod software in emulator mode.

  • BpodSystem.EmulatorMode is automatically set to 0 in normal mode, and 1 in emulator mode.

  • Emulator mode is intended for protocol development; timing data and sound / visual display timing may be imprecise depending on the platform.

  • Inputs are read and the hardware state is indicated on the Bpod console while running a state matrix.

  • When designing a protocol that can be run in emulator mode, block off code that interfaces with unavailable hardware (see example).

Example

% 1. This code connects to a remote TCP server using the SerialEthernet plugin, only if NOT in emulator mode.

if BpodSystem.EmulatorMode == 0

SerialEthernet('Init', 'COM65'); % Set this to the correct COM port for Arduino Leonardo

pause(1);

RemoteIP = [192 168 0 104]; RemotePort = 3336;

SerialEthernet('Connect', RemoteIP , RemotePort);

else

disp('Fake-connected to a fake TCP server')

end