2

I'm not sure if this is the best/cleanest answer but you could have annother button called Autonomos mode off which you would press before you press the sensor off relay on. That button would have go to a different script in that directory that you would call stop.py. fileObject = open("isAutonumous.txt", "w") fileObject.write(0) ...


1

I believe the problem is really in the old OS (or probably rather: Old libs) in use. The Pi4 requires an update to the I/O library for the input pull-up resistor setting to work properly, which is likely used by the above Button class. Try a never version of Rpi.Gpio, when possible. Alternatively, you could add an external pull-up resistor to your button pin ...


Only top voted, non community-wiki answers of a minimum length are eligible