average sample from adc
uint8_t nbsample = 50;

uint16_t average(nbsample) {

    uint32_t tot = 0;
    uint8_t i;
    for(i=0; i < nbsample; i++) {
        tot += ADC;
    }
    return tot / nbsample;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License