close all

result = readmatrix("RUN2_ADC_data.csv");
%result = result(14430:end, : );
result(:,14) = result(:,14)./2;
time = result(:,1)./1000;

temp = 0.000111 .* result(:,4:9)  + 2.31991;

pressure = result(:,10:17).*(0.000015)-6.565;

load_cell = result(:,2:3);
weight = -1.166759307845543e-04 .* 0.5.*(load_cell(:,1) + load_cell(:,2)) + 4.971416323340051e+02;

figure()
scatter(time,weight,10)
title("load cell in Kg")
xlabel("Time in s")
ylabel("KG")
xlim([900.817 911.840])

for x = 1:7
    figure()
    scatter(time,pressure(:,x),10)
    title(sprintf("Pressure channel %d",x))
    xlabel("Time in s")
    ylabel("Pressure")
    xlim([900.817 911.840])
end

for x = 1:6
    figure()
    scatter(time,temp(:,x),10)
    title(sprintf("temperature channel %d",x))
    xlabel("Time in s")
    ylabel("Temprature in C")
    xlim([900.817 911.840])
end
