ttl channel outputs in State Machine r2

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ttl channel outputs in State Machine r2
Hi Kun,

I'm assuming you've used all of the input and LED channels on the port interface boards (normally for nosepokes and LEDs, but unused channels can work as digital GPIO)

You can set the analog input module to detect incoming 3.3 or 5V pulses using its MATLAB class.
The code to set up a channel (for instance, channel 2) is roughly:

myChannel = 2;
A = BpodAnalogIn('COM3');
A.Thresholds(myChannel) = 2.5;
A.ResetVoltages(myChannel) = 1;
A.SMeventsEnabled(myChannel) = 1;

This will return AnalogIn1_2 events each time the line goes from low to high. Unlike the BNC and port input channels, you won't get events when the line goes from high -> low. Also keep in mind that the input channel is not optically isolated, so make sure the input voltage is something reasonable (-10 to +10VDC).

For output, you'd use the WavePlayer class to play 5V pulses on trigger.

I hope this helps!

Messages In This Thread
RE: ttl channel outputs in State Machine r2 - by Josh - 03-14-2019, 12:44 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)