Skip to main content
. 2023 May 12;4(2):102306. doi: 10.1016/j.xpro.2023.102306

Table 2.

MATLAB functions to control the Arduino to trigger the pulse generator channels

Function Description
a = connectArduino() Generates an Arduino instance.
e.g., myArduino = connectArduino();
offPin(a, outpin) Makes TTL state of the specified pin LOW.
e.g., offPin(myArduino, ‘D2’);
onPin(a, outpin) Makes TTL state of the specified pin HIGH.
e.g., onPin(myArduino, ‘D2’);
trgPulse(a, outpin) Generates 1 pulse with 100 ms duration in the specified pin.
e.g., trgPulse(myArduino, ‘D2’);
exampleTimer() A simple example use of MATLAB triggers of the pulse generator. “Start” button starts the timer and sync pulse, and stimulation (when the pulse generator Ch2 is connected to e.g., stimulus isolator or LED driver) is triggered at certain timings.