function sys_sendEventTrig(ioType, ioObject, value, ioAddress)
% Send event trigger
% function sys_sendEventTrig(ioType, ioObject, value, ioAddress)
%
% In:
%   IOTYPE      : Type of IO device
%       'parallel'  : LPT port (LPT address required)
%       'serial'    : COM port
%
%   IOOBJECT    : Object of IO device
%
%   VALUE       : Value you want to send through IO device
%
%   IOADDRESS   : Address of IO device (only required in the case of 'parallel')
%
% Masaki Nakanishi, Swartz Center for Computational Neuroscience, Institute
% for Neural Computation, University of California, San Diego
% Date: Nov-05-2014, Update: Nov-05-2014.

switch ioType
    
    case 'parallel'
        io64(ioObject, ioAddress, value);
        
    case 'serial'
        fwrite(ioObject, value, 'uint8');     
        
end