Hi all!

I am using fhem as controller and am using arduinos with firmata (ethernet) for controlling relays and check for button presses for my home automation.

Unfortunately I am having bouncing issues which I would like to resolve using Bounce2 - but my knowledge seems to be too weak for that :-( I am just trying to connect some buttons to pins 2-6 of an UNO.... In my understanding the following code (adapted from DigitalInput.cpp) should work, but unfortunately it does not :-( - this means, it does not report anything to fhem.... Maybe some of the chiefs have some hints for me?

```
void DigitalInputFirmata::report(void)
{
/* Using non-looping code allows constants to be given to readPort().
* The compiler will apply substantial optimizations if the inputs
* to readPort() are compile-time constants. */
if (TOTAL_PORTS > 0 && reportPINs[0]) {
byte bitmask = portConfigInputs[0];
byte out=0;
if (IS_PIN_DIGITAL(0) && (bitmask & 0x01) && digitalRead(PIN_TO_DIGITAL(0))) out |= 0x01;
if (IS_PIN_DIGITAL(1) && (bitmask & 0x02) && digitalRead(PIN_TO_DIGITAL(1))) out |= 0x02;
if (IS_PIN_DIGITAL(2) && (bitmask & 0x04)) {
if (bouncePINs[2].update()) {
if (bouncePINs[2].read() == HIGH) {
out |= 0x04;
}
}
}
if (IS_PIN_DIGITAL(3) && (bitmask & 0x08)) {
bouncePINs[3].update();
if (bouncePINs[3].read()) out |= 0x08;
}
if (IS_PIN_DIGITAL(4) && (bitmask & 0x10)) {
bouncePINs[4].update();
if (bouncePINs[4].read()) out |= 0x10;
}
if (IS_PIN_DIGITAL(5) && (bitmask & 0x20)) {
bouncePINs[5].update();
if (bouncePINs[5].read()) out |= 0x20;
}
if (IS_PIN_DIGITAL(6) && (bitmask & 0x40))
{
bouncePINs[6].update();
if (bouncePINs[6].read()) out |= 0x40;
}
if (IS_PIN_DIGITAL(7) && (bitmask & 0x80) && digitalRead(PIN_TO_DIGITAL(7))) out |= 0x80;
outputPort(0, out, false);
}
if (TOTAL_PORTS > 1 && reportPINs[1]) outputPort(1, readPort(1, portConfigInputs[1]), false);
if (TOTAL_PORTS > 2 && reportPINs[2]) outputPort(2, readPort(3, portConfigInputs[3]), false);
if (TOTAL_PORTS > 3 && reportPINs[3]) outputPort(3, readPort(3, portConfigInputs[3]), false);
if (TOTAL_PORTS > 4 && reportPINs[4]) outputPort(4, readPort(4, portConfigInputs[4]), false);
if (TOTAL_PORTS > 5 && reportPINs[5]) outputPort(5, readPort(5, portConfigInputs[5]), false);
if (TOTAL_PORTS > 6 && reportPINs[6]) outputPort(6, readPort(6, portConfigInputs[6]), false);
if (TOTAL_PORTS > 7 && reportPINs[7]) outputPort(7, readPort(7, portConfigInputs[7]), false);
if (TOTAL_PORTS > 8 && reportPINs[8]) outputPort(8, readPort(8, portConfigInputs[8]), false);
if (TOTAL_PORTS > 9 && reportPINs[9]) outputPort(9, readPort(9, portConfigInputs[9]), false);
if (TOTAL_PORTS > 10 && reportPINs[10]) outputPort(10, readPort(10, portConfigInputs[10]), false);
if (TOTAL_PORTS > 11 && reportPINs[11]) outputPort(11, readPort(11, portConfigInputs[11]), false);
if (TOTAL_PORTS > 12 && reportPINs[12]) outputPort(12, readPort(12, portConfigInputs[12]), false);
if (TOTAL_PORTS > 13 && reportPINs[13]) outputPort(13, readPort(13, portConfigInputs[13]), false);
if (TOTAL_PORTS > 14 && reportPINs[14]) outputPort(14, readPort(14, portConfigInputs[14]), false);
if (TOTAL_PORTS > 15 && reportPINs[15]) outputPort(15, readPort(15, portConfigInputs[15]), false);
}
```

(Experimenting with pin 2).... Thanks in advance for any helpful hint!!!!!