ADC1_GC &= ~0x20; | ADC1_GC &= ~0x20; | ||||
mode = ADC1_CFG & ~0xC000; | mode = ADC1_CFG & ~0xC000; | ||||
if (num >= 32) { | if (num >= 32) { | ||||
mode |= ADC_CFG_AVGS(3); | mode |= ADC_CFG_AVGS(3); | ||||
//Serial.println(ADC_CFG_AVGS(3), BIN); | //Serial.println(ADC_CFG_AVGS(3), BIN); | ||||
} else { | } else { | ||||
mode |= ADC_CFG_AVGS(0); | mode |= ADC_CFG_AVGS(0); | ||||
} | } | ||||
ADC1_CFG = mode; | ADC1_CFG = mode; | ||||
//enable averaging | //enable averaging |