function drawing = getpic(com_port)

clc
fclose(instrfind);

%initialize all varibles
drawing = cell(1,26);
drawingfound = false;
let_ct = 26;
j = 1;
i = 0;

%open serial port 
s = serial(com_port); 
set(s,'BaudRate',38400,'DataBits',8,'Parity','none');
    %,'InputBufferSize',28);
fopen(s);

%alert user that matlab is ready for serial communication
disp('SERIAL PORT OPEN');

notdone = true;

for idx = 1+'A'-'A':let_ct
    fprintf('Input %c.\n', idx+'A'-1);
    drawing{idx} = zeros(80,100);
    while notdone
        data = [];
        % wait for one character
        while (isempty(data))
            data = fscanf(s, '%c', 1);
        end
        if (data == 'N')
            fprintf('Got it... \n');
            drawingfound = true;
            j = 1;
        elseif (data == 'E')
            fprintf('\nDone Processing!\n');
            drawingfound = false;
            notdone = false;
        elseif drawingfound
            if i > 0 && data == 10
                i=0;
                j = j+1;
                fprintf('|');
                
            elseif ~(data == 13 || data == 10) 
                %carriage return is 13, 10 is newline
                i = i+1;
                drawing{idx}(j,i) = str2double(data);
            end
        end
    end
    notdone = true;
end

disp('Complete! Thank you!');

%close serial port
fclose(s);
delete(s);

end