function varargout = Classroom_security(varargin)
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Classroom_security_OpeningFcn, ...
'gui_OutputFcn', @Classroom_security_OutputFcn, ...
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
gui_mainfcn(gui_State, varargin{:});
function Classroom_security_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = Classroom_security_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function Classroom_Callback(hObject, eventdata, handles)
function pushbutton2_Callback(hObject, eventdata, handles)
a = arduino('COM8', 'UNO','Libraries',{'Ultrasonic','Servo'})
configurePin(a,'D11','Tone')
mouv=readDigitalPin(a,'D10')
playTone(a,'D11',1200,1);
function pushbutton3_Callback(hObject, eventdata, handles)
a = arduino('COM8', 'UNO','Libraries',{'Ultrasonic','Servo'})
sensor= ultrasonic(a,'D12','D13');
x=(readDistance(sensor))*100
function pushbutton4_Callback(hObject, eventdata, handles)
a=arduino('COM6','UNO','Libraries',{'servo'})
gaz=readDigitalPin(a,'A0')
writePosition(servo1, .7)
function pushbutton5_Callback(hObject, eventdata, handles)
a = arduino('COM8', 'UNO','Libraries',{'Ultrasonic','Servo'})
capteurflamme=readDigitalPin(a,'D8')
configurePin(a,'D11','Tone')
capteurflamme=readDigitalPin(a,'D8')
writeDigitalPin(a,'D7',1);
writeDigitalPin(a,'D7',0);