function writeUSB245(byte)
%usage:
%   writeUSB245(data);
%
%Updates current value of 8-bit digital input/output buffer on
%FTDI UM245R high-speed USB digital I/O module using the value specified
%via input paramater 'data'.  NOTE: Only lines configures as OUTPUT lines
%will be affected by this command.  Input lines always reflect the state of
%their physical connections.
%
%The config_ftdi() or config_ftdi2() command must be run to configure the
%UM245R device before any attempt to read or write to it.
%
%Use readUSB245() to read the current value of the input/output buffer.
%
%See http://usd-apps.usd.edu/coglab/psyc770/USB245.html for detaills
global cogent;

%test for correct number of input arguments
if(nargin ~= 1)
    error('usage: writeUSB245(data)');
end

status=USB245(cogent.io.ftdiObj,1,byte);

