MATLAB Support Package for Parallax BASIC Stamp
25 Jul 2011
(Updated 22 Aug 2011)
MATLAB library for communicating with a BASIC Stamp 2 and Board of Education (BoE) kit
% NOTE: This function uses EasyGUI, a tool for easily making graphical
% interfaces in MATLAB. Before running this function, <a href="http://www.mathworks.com/matlabcentral/fileexchange/22936">download EasyGUI</a> and
% install it.
% This function does not have a direct analog in the book. Use the same
% hardware setup as measureRot.
% This function measures the resistance of the potentiometer every 100ms
% (or so) and plots the resulting time to a stripchart that updates in
% realtime. This also serves as an example of how MATLAB can be used to
% collect and analyze data from the BS2; the same code that plots the time
% data could easily have put it in a vector for analysis using MATLAB's
% extensive toolset.
% MATLAB Support Package for BASIC Stamp
% Version 1.0
% Copyright 2011 The MathWorks, Inc.
error('EasyGUI not found. Please install EasyGUI and try again.');
bs = stamp.BasicStamp('COM4'); %replace with your BS2 serial port
chart = gui.stripchart(gca,101);
for i = 1:100
time = bs.getRCTime(7,1);