#include "detectled.h"


#define CHANNELS 3
#define SAMPLES 20


extern std::vector<c_button *> buttonlist;


c_leds *ledlist_ptr;


void handleDetectLed(bool newstate)
{

  for(auto &&button : buttonlist)
  {
    if(button->isPressed())
    {
      ledlist_ptr->turnOnLed(button->getColor());
    }
    else
    {
      ledlist_ptr->turnOffLed(button->getColor());
    }
  }
}

void initDetectLed(void)
{
  ledlist_ptr = getledlist();
#ifndef UNIT_TEST
  analogReadResolution(10);
#endif
}

