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.