#include "Button.h"

Button::Button(uint8_t id)
{
    this->id = id;
}

bool Button::isPressed()
{
  if(this->id == MICROBIT_ID_BUTTON_A)
    return uBit.buttonA.isPressed();
  else if(this->id == MICROBIT_ID_BUTTON_B)
    return uBit.buttonB.isPressed();
  else if(this->id == MICROBIT_ID_BUTTON_AB)
    return uBit.buttonAB.isPressed();
  else
    return 0;
}

Button Button_A(MICROBIT_ID_BUTTON_A);
Button Button_B(MICROBIT_ID_BUTTON_B);
Button Button_AB(MICROBIT_ID_BUTTON_AB);



