function [ mote ] = leggi_dat( nomeFile )

inizio = datenum('15/06/2007  15:45:00','dd/mm/yyyy HH:MM:SS');
inizio131 = datenum('15/06/2007  19:08:00','dd/mm/yyyy HH:MM:SS');
fineTrans = datenum('15/06/2007  22:00:00','dd/mm/yyyy HH:MM:SS');
fine = datenum('26/06/2007  09:55:00','dd/mm/yyyy HH:MM:SS');
dt = datenum('Jan 0, 0000  0:00:30.0000');

data = load(nomeFile);

mote.name = nomeFile(end-6:end-4);

if ( strcmp(mote.name,'131') == 1 )
    start = round((fineTrans-inizio131)/dt);
    stop = round((fine-inizio131)/dt);
else    
    start = round((fineTrans-inizio)/dt);
    stop = round((fine-inizio)/dt);
end

id = data(start:stop,1);
temperatureR = data(start:stop,2);
humidityR = data(start:stop,3);
totalRadiationR = data(start:stop,4);
activeRadiationR = data(start:stop,5);
internalVoltageR = data(start:stop,6);

mote.time = id;
mote.temperature = -39.60 + 0.01*temperatureR;                                    % [°C]
mote.humidity = -4 + 0.0405*humidityR + (-2.8 * 10^-6)*(humidityR.^2);            % [%]
mote.humidity_true = (mote.temperature - 25) .* (0.01 + 0.00008*humidityR) + mote.humidity; % [%]
mote.activeRadiation = 0.625 * 1e6 * (activeRadiationR/100000) * 1000;            % [lux]
mote.totalRadiation = 0.769 * 1e5 * (totalRadiationR/100000) * 1000;              % [lux]
mote.internalVoltage = internalVoltageR/4096 * 3;                                 % [V]
