Ok for the code,

But scheme ( are there pullup or pulldown resistors ....) etc, etc
Would be great ...

Alain