Bounce (and Bounce 2) Library Official Question Forum

lukpuch:
How can I use it with PCF8574 ?

As far as I know, the bounce2 library was exclusively made for Arduino based boards or at limit for the Wiring boards.
Hence, you just can't execute a library for a device that was not planned to work with it. You should search elsewhere your topic, e.g. try to googling PCF8574 debounce library.

Any suggestions would be welcomed ?

Ian

Try to load my above written code example in your MEGA board, change some PIN addresses if you need it, and then report back whether it's working or not.

Guys, please don't be generic in your questions. Explain, in details, the problems that you experience, and then we can discuss on how to solve them.