Scotty101 and Lloys Seaton,
We thank you so much for your wonderful GPIO programs. They go a long way to setting up a Relay Control program we're trying to develop to possibly control a model railroad setup.
We're both rookies at Python. Thanks to your program we are now able to activate all four relays and read all four inputs using GPIO 17,18,27 and 22 for outputs, and GPIO 23,24,25 and 4, for inputs. We were able to modify the program labels to show Relays and Inputs, and control the Relays via Menu clicks, and alter the LED in response to Inputs.
Our next step has been a total failure so far under either of your wonderful Tkinter GPIO programs. We want to activate each of the relays, automatically via the program as a result of an input on one of the four input ports, without having to click on the menu. Something like the fan automatically coming on in the cooling system of a car, when the engine gets too hot).
The variety of errors we've managed to trigger is impressive and usually 4 or 5 of them at once, varying from 'the GPIO port has not been set' to complaints about global variables not set, but nothing has ever started the fan. We've tried to adapt 6 or 7 different programs out there, all to no avail.
We've been able to do this quite successfully in Python, but have hit a brick wall within the Tkinter menu system.
Can either of you suggest a way to do this? Your help would be greatly appreciated.