fg71
A very useful approach to debug GPIO pin on Raspberry Pi is to use the command watch.
 
Lets pretend we have setup OpenPLC program to set the GPIO pin 4 (WiringPi), that is GPIO 23 for BCM or Physical pin 16.
-> watch -n .5 gpio read 4
 
We use the command gpio from WiringPi (include when we install WiringPi) and read GPIO pin 4
The watch command execute a program periodically, in this case every half second or 500ms and showing the output
 
[203128%2F9166242%2Fmceclip0]
 
Or if we like to get more 1 GPIO we could use pinctrl or install raspi-gpio if we use RPi4 or older
 
-> watch -n .5 pinctrl get 23,24,25
 
[203128%2F9166308%2Fmceclip0]
Reply 0 0
Reply