Code covered by the BSD License  

Highlights from
MATLAB Support Package for Velleman K8055/VM110 Experiment Board

MATLAB Support Package for Velleman K8055/VM110 Experiment Board

by

 

MATLAB library for communicating with a Velleman K8055/VM110 USB Experiment Interface Board

AnalogPlot.m
% Script that collects data from an analog port for a period of time and
% then plots it.

%   Copyright 2011 The MathWorks, Inc.

analogchan = 1; % Analog input to be read
runtime = 10; % How long the script will run in seconds
samplefreq = 10; % How many times per second the input will be sampled


board = vellboard.ExperimentBoard;
sampleT = 1/samplefreq;

data = zeros(1,runtime*samplefreq);

for i = 1:runtime*samplefreq
    data(i) = board.readAnalog(analogchan);
    pause(sampleT);
end

plot(sampleT:sampleT:runtime,data);

delete(board);

Contact us