close all
clear all

delete(instrfind(('Port'),('COM19')));
s=serial('COM19','Baudrate',9600,'DataBits',8);
fopen(s);
ylim([-1 6]);
h=animatedline;
x=1:100;
j=1;
while(1)
    for i=1:100
        voltage=fscanf(s);
        y(i)=str2double(voltage); 
        yy(j)=y(i);
        j=j+1;
    end
    addpoints(h,x,y);
    drawnow;
    clearpoints(h);
end