clc
clear all
close all

data = fopen('./data.txt', 'r');
update = 0;
prev = 0;
index = 1;
while(~feof(data))
    a = fgetl(data);
    if(~isempty(a) && strcmpi(a(1:3), 'CNT') && ~prev)
        update = 1;
    else
        prev = update;
    end
    
    if(prev)
        cnt(index) = str2double(a(1:8));
        adc(index) = str2double(a(9:end));
        index = index + 1;
    end
    
end

fclose(data);

figure(1)
hold on
plot(cnt, adc, 'o')
xlabel('CNT')
ylabel('ADC')
grid on
hold off

