Code covered by the BSD License  

Highlights from
VU-LEGO Real Time Target

image thumbnail

VU-LEGO Real Time Target

by

 

30 Dec 2010 (Updated )

A user-friendly Blockset for embedding real time Simulink designs on the LEGO Mindstorms NXT brick.

w32serial.m
function obj = w32serial(portname, varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% {t@CivOj𗘗pƂɂ钼ڂ邢
%% ԐړIȑQɊւāATColbgVXe͂
%% ӔC𕉂˂܂B
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% w32serial NXRXgN^

if ~ispc
  error('This command is for the PC(Windows) version only.')
end

if nargin == 0
    error('You must provide a port name as the first input.(For example, "COM1")')
elseif ~isa(portname,'char')
  error('The first input argument must be a port name.(For example, "COM1")');
end



obj.PortName = portname;
%Global defaults
obj.BaudRate = 9600;
obj.Parity = 'NOPARITY';
obj.DataBits = 8;
obj.StopBits = 1;
obj.FileID = -1;
obj.InputBufferSize = 512;
obj.CurrentState = 'Closed';

obj = class(obj,'w32serial');
% Take care of any parameters set at the command line
obj = set(obj,varargin{:});
%aviobj.FileHandle = avi('open',filename);
% elseif nargin == 1 & isa(obj,'w32serial')
%     data = a;
% elseif nargin == 2 & ischar(label) & isnumeric(a)
%     data.x = a(2, :);
%     data.y = a(1, :);
%     data.label = label;
%     data = class(data,'sigbdata');
% else
%     error('Paremeter error!!!')
% end

Contact us