function varargout = ledgui(varargin)

gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ledgui_OpeningFcn, ...
                   'gui_OutputFcn',  @ledgui_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end

function ledgui_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);

clear all;
clc;
global aruno;
aruno = arduino('com4','uno');

function varargout = ledgui_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;

function ON_Callback(hObject, eventdata, handles)

global aruno;
writeDigitalPin(aruno,'D13',1);

function OFF_Callback(hObject, eventdata, handles)

global aruno;
writeDigitalPin(aruno,'D13',0);