#include "Arduino.h" #include "detectled.h" #include "buttons.h" #include "board.h" #define CHANNELS 3 #define SAMPLES 20 unsigned int detectled[CHANNELS] = {0,0,0}; uint32_t detectledRaw[CHANNELS][SAMPLES]; const uint32_t inputs[CHANNELS] = {DETECT1, DETECT2, DETECT3}; const uint32_t leds[CHANNELS] = {LED1, LED2, LED3}; uint32_t sampleIndex = 0; void handleDetectLed( void ) { for(int i = 0;i < CHANNELS;i++) { detectledRaw[i][sampleIndex] = analogRead(inputs[i]); } sampleIndex++; if(sampleIndex == SAMPLES) { for(int i = 0;i