Button Library - multiple instances of class

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
niky94547
Posts: 2
Joined: 31 May 2019 10:51

Button Library - multiple instances of class

Post by niky94547 » 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...

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);
}
 } 

and gives us following error on compiler ....

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

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,

rkv
Posts: 4
Joined: 15 Jul 2019 13:13

Re: Button Library - multiple instances of class

Post by rkv » 19 Nov 2019 16:36

Thank you for your post. This is a bug and we will fix it soon.

niky94547
Posts: 2
Joined: 31 May 2019 10:51

Re: Button Library - multiple instances of class

Post by niky94547 » 22 Nov 2019 14:51

Hi,

Thanks a lot for your reply and support. We look forward to implement library within our project. Just drop an notification once fixed.

Br,

Post Reply