close all; clc;

try
    fclose(s);
catch
    warning('s ne peut pas être fermé');
end
s = serial('COM7');
set(s,'BaudRate',9600,'Parity','none')
set(s,'DataBits',8)
set(s,'StopBits',1)
fopen(s);
pause(2);


U1 = check_u(000);
U2 = check_u(000);
w = strcat('0',num2str(U1,'%03d'),num2str(U2,'%03d'));
fwrite(s,w,'uint8');

fclose(s);



