     adc->setAveraging(1);
     timeElapsed = 0;
     for(uint32_t i=0; i<num_samples; i++) {
-        adc->analogRead(A0, ADC_NUM::ADC_0);
+        adc->analogRead(A0, ADC_0);
     }
     float one_avg_time = timeElapsed/num_samples;
 

        adc->setAveraging(averages[i]);
        timeElapsed = 0;
        for(uint32_t j=0; j<num_samples; j++) {
            adc->analogRead(A0, ADC_NUM::ADC_0);
        }
        float time = (float)timeElapsed/num_samples;
        avg_times[i] = time;

    bool pass_test = true;

    // ready if value lies out of [1.0,2.0] V
    adc->enableCompareRange(1.0*adc->getMaxValue(ADC_0)/3.3, 2.0*adc->getMaxValue(ADC_0)/3.3, 0, 1, ADC_0);


    pinMode(pin_cmp, INPUT_PULLUP); // set to max
    // this should be ok
    value = adc->analogRead(pin_cmp, ADC_0);
    if(adc->adc0->fail_flag != ADC_ERROR::CLEAR) {
        Serial.println("Some other error happened when comparison should have succeeded.");
        adc->adc0->printError();
