bxparks / AceButton

An adjustable, compact, event-driven button library for Arduino that debounces and dispatches events to a user-defined event handler.
MIT License
393 stars 37 forks source link

call of overloaded 'init(int)' is ambiguous #61

Closed joysfera closed 3 years ago

joysfera commented 3 years ago

This did work OK in v1.3.5, fails after upgrading to v1.8.0 with call of overloaded 'init(int)' is ambiguous compiler error:


#define PIN 0
#include <AceButton.h>
using namespace ace_button;
void handleButton(AceButton* /*button*/, uint8_t eventType, uint8_t /*buttonState*/); // forward declaration
ButtonConfig buttonConfig;
AceButton button(&buttonConfig);

void setup()
{
    buttonConfig.setEventHandler(handleButton);
    buttonConfig.setFeature(ButtonConfig::kFeatureClick);
    tlacitkoConfig.setFeature(ButtonConfig::kFeatureDoubleClick);
    tlacitkoConfig.setFeature(ButtonConfig::kFeatureLongPress);
    button.init(PIN);
bxparks commented 3 years ago

Same as #60. Use:

const uint8_t PIN = 0;
...
button.init(PIN);