Description
Sends a sequence of onset times and voltages describing a train of pulses.
The train can be mapped to any output channel by specifying a custom train ID in the output channel's parameters (see setCustomTrainID).
Two custom trains can be created, with 1,000 pulses each (PulsePal r0.4).
While this function allows custom onset times, the duration of each pulse in the custom train is set by adjusting each output channel's parameters.
Pulses that are continuous or overlapping will merge (see the Parameter guide)
If set to biphasic pulses, the voltage specified for each pulse is sign-inverted for the second phase (i.e. if +5V for phase 1, -5V is used automatically for phase 2)
Syntax
sendCustomPulseTrain(uint8_t ID, uint8_t nPulses, float customPulseTimes[], float customVoltages[])
Parameters
ID: The custom pulse train to program (1 or 2)
nPulses: The number of pulses in the train
customPulseTimes: An array of pulse onset times in seconds.
customVoltages: An array containing one voltage for each pulse.
Returns
None
Example
// Set output ch2 to play a train of three 1ms pulses when triggered:
// one 5V pulse at 0s, one 2V pulse at 0.005s and one -10V pulse at 0.05s.
float pulseTimes[3] = { 0, 0.005, 0.05 };
float voltages[3] = { 5, 2, -10 };
PulsePalObject.setPhase1Duration(2, 0.001); // set output channel 2 to use 1ms pulses
PulsePalObject.setCustomTrainID(2, 1); // set output channel 2 to use custom pulse train 1
sendCustomPulseTrain(1, pulseTimes, voltages); // send custom pulse train 1 to the device