uint32_t sum = 0; | uint32_t sum = 0; | ||||
do { | do { | ||||
sum += output[binFirst++]; | sum += output[binFirst++]; | ||||
} while (binFirst < binLast); | |||||
} while (binFirst <= binLast); | |||||
return (float)sum * (1.0 / 16384.0); | return (float)sum * (1.0 / 16384.0); | ||||
} | } | ||||
void averageTogether(uint8_t n) { | void averageTogether(uint8_t n) { |
uint32_t sum = 0; | uint32_t sum = 0; | ||||
do { | do { | ||||
sum += output[binFirst++]; | sum += output[binFirst++]; | ||||
} while (binFirst < binLast); | |||||
} while (binFirst <= binLast); | |||||
return (float)sum * (1.0 / 16384.0); | return (float)sum * (1.0 / 16384.0); | ||||
} | } | ||||
void averageTogether(uint8_t n) { | void averageTogether(uint8_t n) { |