Button Library - multiple instances of class
Posted: 14 Nov 2019 20:01
Hi,
We try to use library ZUNO_Button with multiple instances for buttons. Here is just a sample code with array of two instances...
and gives us following error on compiler ....
could you suggest any other approach or point our fault. We test same approach with original librarry on Arduino mega and it's ok.
Thanks a lot,
We try to use library ZUNO_Button with multiple instances for buttons. Here is just a sample code with array of two instances...
Code: Select all
#include <ZUNO_Buttons.h>
#define BTN_PIN1 4
#define BTN_PIN2 5
PinButton btn[2][2] = {
{BTN_PIN1,true},
{BTN_PIN2,true},
};
void setup() {
Serial.begin(115200);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
}
void loop() {
for( int i=0; i < sizeof 2; ++i ) {
btn[i][i].update();
btn[i][i].startDispatch();
if(btn[i][i].isReleased()){
}
if(btn[i][i].isSingleClick()){
}
if(btn[i][i].isLongClick()){
}
if(btn[i][i].isDoubleClick()){
}
btn[i][i].endDispatch();
delay(20);
}
}
Code: Select all
C:\Users\USER\AppData\Local\Temp\arduino_build_438942\sketch_nov13a_sdcpp_.cpp:874:1:error: uCxx:Can't find method __cxx__PinButton__init00 for object btn of class PinButton
uCxx returned error code:-1
Thanks a lot,