I was trying to write a program which can take input from button. Here is the code:
from gpiozero import Button btn = Button(4) while True: btn.wait_for_press() print('You pressed me') btn.wait_for_release() print('You released me')
Whenever I am pressing the button, my ssh connection gets freezes for a few seconds and gets terminated with the following error message.
"ssh packet_write_wait broken pipe" Please help!
I am on Raspbian stretch, Pi model 1 B+.
Connection is as follows:
ground pin ---> button ---> pin 4 [BCM]
I can see every time when I press button, the red system LED shuts down for that period.