Você está na página 1de 10

Trabajo Colaborativo

Construccion de la Solución

Presentado Por:

Edgar David Suarez

Código:

1023919249

Grupo:

203036A_291

Presentado A:

Juan Monroy

Universidad Nacional Abierta y a Distancia

Bogotá D.C

3 de Noviembre de 2016
function varargout = matrizLedGUIDE(varargin)
% MATRIZLEDGUIDE M-file for matrizLedGUIDE.fig
% MATRIZLEDGUIDE, by itself, creates a new MATRIZLEDGUIDE or raises
the existing
% singleton*.
%
% H = MATRIZLEDGUIDE returns the handle to a new MATRIZLEDGUIDE or
the handle to
% the existing singleton*.
%
% MATRIZLEDGUIDE('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in MATRIZLEDGUIDE.M with the given input
arguments.
%
% MATRIZLEDGUIDE('Property','Value',...) creates a new
MATRIZLEDGUIDE or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before matrizLedGUIDE_OpeningFcn gets
called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to matrizLedGUIDE_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only
one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help matrizLedGUIDE

% Last Modified by GUIDE v2.5 02-Jul-2014 16:48:46

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @matrizLedGUIDE_OpeningFcn, ...
'gui_OutputFcn', @matrizLedGUIDE_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
% End initialization code - DO NOT EDIT
% --- Executes just before matrizLedGUIDE is made visible.
function matrizLedGUIDE_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to matrizLedGUIDE (see VARARGIN)
x=imread('logo1.jpg');
imshow(x)
% image(x),colormap(map),axis off,hold on

% Choose default command line output for matrizLedGUIDE


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes matrizLedGUIDE wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = matrizLedGUIDE_OutputFcn(hObject, eventdata,
handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

global A
A=zeros(5,5);
% Get default command line output from handles structure
varargout{1} = handles.output;

% --- Executes on button press in rb11.


function rb11_Callback(hObject, eventdata, handles)
% hObject handle to rb11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(1,1)=get(hObject,'value');

% Hint: get(hObject,'Value') returns toggle state of rb11

% --- Executes on button press in rb21.


function rb21_Callback(hObject, eventdata, handles)
% hObject handle to rb21 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(1,2)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb21
% --- Executes on button press in rb31.
function rb31_Callback(hObject, eventdata, handles)
% hObject handle to rb31 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(1,3)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb31

% --- Executes on button press in rb41.


function rb41_Callback(hObject, eventdata, handles)
% hObject handle to rb41 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(1,4)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb41

% --- Executes on button press in rb51.


function rb51_Callback(hObject, eventdata, handles)
% hObject handle to rb51 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(1,5)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb51

% --- Executes on button press in rb12.


function rb12_Callback(hObject, eventdata, handles)
% hObject handle to rb12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(2,1)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb12

% --- Executes on button press in rb22.


function rb22_Callback(hObject, eventdata, handles)
% hObject handle to rb22 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(2,2)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb22

% --- Executes on button press in rb32.


function rb32_Callback(hObject, eventdata, handles)
% hObject handle to rb32 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(2,3)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb32

% --- Executes on button press in rb42.


function rb42_Callback(hObject, eventdata, handles)
% hObject handle to rb42 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(2,4)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb42

% --- Executes on button press in rb52.


function rb52_Callback(hObject, eventdata, handles)
% hObject handle to rb52 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(2,5)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb52

% --- Executes on button press in rb13.


function rb13_Callback(hObject, eventdata, handles)
% hObject handle to rb13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(3,1)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb13

% --- Executes on button press in rb23.


function rb23_Callback(hObject, eventdata, handles)
% hObject handle to rb23 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(3,2)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb23

% --- Executes on button press in rb33.


function rb33_Callback(hObject, eventdata, handles)
% hObject handle to rb33 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(3,3)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb33

% --- Executes on button press in rb43.


function rb43_Callback(hObject, eventdata, handles)
% hObject handle to rb43 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(3,4)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb43

% --- Executes on button press in rb53.


function rb53_Callback(hObject, eventdata, handles)
% hObject handle to rb53 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(3,5)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb53

% --- Executes on button press in rb14.


function rb14_Callback(hObject, eventdata, handles)
% hObject handle to rb14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(4,1)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb14

% --- Executes on button press in rb24.


function rb24_Callback(hObject, eventdata, handles)
% hObject handle to rb24 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(4,2)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb24

% --- Executes on button press in rb34.


function rb34_Callback(hObject, eventdata, handles)
% hObject handle to rb34 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A
A(4,3)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb34

% --- Executes on button press in rb44.


function rb44_Callback(hObject, eventdata, handles)
% hObject handle to rb44 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(4,4)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb44

% --- Executes on button press in rb54.


function rb54_Callback(hObject, eventdata, handles)
% hObject handle to rb54 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(4,5)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb54

% --- Executes on button press in rb15.


function rb15_Callback(hObject, eventdata, handles)
% hObject handle to rb15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(5,1)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb15

% --- Executes on button press in rb25.


function rb25_Callback(hObject, eventdata, handles)
% hObject handle to rb25 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(5,2)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb25

% --- Executes on button press in rb35.


function rb35_Callback(hObject, eventdata, handles)
% hObject handle to rb35 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(5,3)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb35
% --- Executes on button press in rb45.
function rb45_Callback(hObject, eventdata, handles)
% hObject handle to rb45 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(5,4)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb45

% --- Executes on button press in rb55.


function rb55_Callback(hObject, eventdata, handles)
% hObject handle to rb55 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global A

A(5,5)=get(hObject,'value');
% Hint: get(hObject,'Value') returns toggle state of rb55

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
IO=arduino('com3')

for i=2:1:13
IO.pinMode(i,'OUTPUT')
end

for i=2:1:6
IO.digitalWrite(i,1)
end
for i=7:1:13
IO.digitalWrite(i,0)
end

global A
A

while true
for j=1:1:5

if A(j,1)==1
IO.digitalWrite(2,0)
end
if A(j,2)==1
IO.digitalWrite(3,0)
end
if A(j,3)==1
IO.digitalWrite(4,0)
end
if A(j,4)==1
IO.digitalWrite(5,0)
end
if A(j,5)==1
IO.digitalWrite(6,0)
end

IO.digitalWrite(14-j,1)

pause(0.00001)

IO.digitalWrite(14-j,0)
if A(j,1)==1
IO.digitalWrite(2,1)
end
if A(j,2)==1
IO.digitalWrite(3,1)
end
if A(j,3)==1
IO.digitalWrite(4,1)
end
if A(j,4)==1
IO.digitalWrite(5,1)
end
if A(j,5)==1
IO.digitalWrite(6,1)
end

end
end

% --- If Enable == 'on', executes on mouse press in 5 pixel border.


% --- Otherwise, executes on mouse press in 5 pixel border or over text1.
function text1_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to text1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes during object creation, after setting all properties.


function axes2_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: place code in OpeningFcn to populate axes2

% --- Executes on button press in pb2.

Você também pode gostar