Raspberry Pi 3:: Python code for Programming GPIO and RS232 - Raspberry Pi Forums


dear friends,

have requirement using raspberry pi 3,as m beginner in need .

below requirement.

need monitor 1 gpio pin continuously using python script, , when gpio on ,the program should send command (xyz) continuously through rs232 (8,10) port. should stop sensing when gpio off.

code should run , when raspberry pi on , start monitoring gpio.

check functionality loop test in rs232 connecting tx pin rx, if send command through tx, should receive through rx ,for shorting 8 , 10 pin of raspberry pi 3.

kindly me make code above requirement using python.

thank you,
vipinraj kk

what have tried? how did fail? stuck?

gpiozero library module provides easy way monitor gpio status. https://gpiozero.readthedocs.io/en/v1.3.1/

may find pyserial library useful working serial port.

running solution @ startup see: https://www.raspberrypi.org/documentati ... c-local.md


raspberrypi



Comments