Ok. I spend few hours thinking that there must be something wrong with code or HW but the real problem is quite weird.
I have rsp model 2B adn few programs running on the device. Just one program is using pin 36 as listener for button press.
Now the funny part :-) If the pin has nothing on it, totally nothing, i get correct values. In other words, program is waiting for button press.
If i connect ONE wire ( cca 10 cm wire ) to that pin, WITHOUT to connect the other part of the wire to GND, i get impulse like if the button was pressed ??
If i leave this wire connected and restart the whole rsp i get the same situation, auto triggering. Wtf ?.
I disconnect the wire, everything works OK. Is it possible that there is some static picked up by this wire and if so, how to solve this ?
GM