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

LEDSlider.m
% Script that uses an EasyGUI slider to control all of the output indicator
% lights. 

%   Copyright 2011 The MathWorks, Inc.

board = vellboard.ExperimentBoard;

slidergui = gui.autogui('Location','float'); %setup GUI
slider = gui.slider();
slider.ValueRange = [0 10];
slider.Value = 0;
quit = gui.togglebutton('Quit');

while(~quit.Value)
    for i = 1:8; %digital outputs
        if slider.Value >= i
            board.writeDigital(i,1);
        else
            board.writeDigital(i,0);
        end
    end
    
    for i = 1:2; %analog outputs
        if slider.Value >= (i+8)
            board.writeAnalog(i,255);
        else
            board.writeAnalog(i,0);
        end
    end
    drawnow; %allows waiting commands to exectue; otherwise, MATLAB would 
             %be too busy with the infinite loop to do anything else.
end

%cleanup
delete(slidergui);
delete(board);

Contact us