Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple TTL out help
#1
Hello,

I am new to Bpod programming and running into some basic roadblocks as I learn to develop my own protocol. 

For now, I just want to generate a TTL pulse with a specific delay from a specific BNC port on my Bpod r2 state machine. I have managed to launch the code, however I keep getting error messages that do not indicate (to me) what I am doing incorrectly.


Code:
function TTLpulse
global BpodSystem

MaxTrials = 10;

S = BpodSystem.ProtocolSettings;
if isempty(fieldnames(S))
% no field names needed
end

BpodParameterGUI('init',S);

for currentTrial = 1:MaxTrials
  S = BpodSystem.ProtocolSettings;

  sma = NewStateMachine()
  sma = AddState(sma, 'Name', 'Trigger1', 'Timer', 0, 'StateChangeConditions', {'BNC1', 'High'}, 'OutputActions', {});
  sma = AddState(sma, 'Name', 'Delay', 'Timer', 10, 'StateChangeConditions', {'Tup', 'exit'}, 'OutputActions', {});
  SendStateMatrix(sma);  
  RawEvents = RunStateMatrix;

end

end

Thank you for any help, advice, or resources for programming BNC TTL pulses from a Bpod r2.
Reply


Messages In This Thread
Simple TTL out help - by k8flr - 03-06-2020, 04:22 PM
RE: Simple TTL out help - by Josh - 03-09-2020, 01:34 AM
RE: Simple TTL out help - by k8flr - 03-09-2020, 03:33 PM
RE: Simple TTL out help - by Josh - 03-10-2020, 12:14 AM
RE: Simple TTL out help - by k8flr - 03-12-2020, 09:27 PM

Forum Jump: