#include <mechButton.h>
#include "RGBLED.h"

RGBLED      theRGBLED(9,10,11,false);   //  RGB LED this one is neg common.
mechButton  redBtn(2);                  //
mechButton  greenBtn(3);                //
mechButton  yellowBtn(4);               //


void setup() {
  
  redBtn.setCallback(gotRed);
  greenBtn.setCallback(gotGreen);
  yellowBtn.setCallback(gotYellow);
}


void gotRed(void) {

  if (!redBtn.getState()) theRGBLED.setColor(&red);
}


void gotGreen(void) {

  if (!greenBtn.getState()) theRGBLED.setColor(&green);
}


void gotYellow(void) {

  if (!yellowBtn.getState()) theRGBLED.setColor(&yellow);
}

void loop() { idle(); } // idle() lets the magic happen.