I am writing a PyModbus asynchronous updating server based on the example on the Pymodbus Asynchronous Server Example and I want to link the states of the coils to GPIO pin states, such as when coil 1 is True pin 21 is high and when coil 1 is False pin 21 is low without having a separate client check the coil status. Is it possible to link the coil directly to the pins? I am using a PI Zero for this project.
If you want to look at my code here the link to my git. I know the value are stored in a variable. I am not sure where I can pull them from to link them to the pins and have them regularly get updated.
I was using the getValue command wrong before.
Within the updating_writer I used:
doing this I can now set a conditional statement to change the GPIO pins.