Average value for ADC (datalogger), code restructured (datalogger)