GPIO (General Purpose Input/Output) PINs are well explained on Raspberry Pi documentation, https://www.raspberrypi.org/documentation/computers/os.html#gpio-and-the-40-pin-header.
GPIO in Python documentation and some examples are in .
**In this project we use BOARD mode (GPIO.setmode(GPIO.BOARD)
) ie. the GPIO port numbers will follow the smaller, ordered numbers on the board, "Physical/Board". See for detailed info of all the PINs. In the picture below here the numbers are displayed in the middle of the right hand side graph, inside the white circles.
Controlling PINS their input/output:
gpiozero
tool which is installed by default:
GPIO.input(16) == 0
GPIO.input(18) == 1
GPIO.input(16) == 1
GPIO.input(18) == 0
GPIO.input(16) == 1
GPIO.input(18) == 1
(ie. when both magnetic switches are open)
# setup
GPIO.setup(11, GPIO.OUT)
# Trigger open/close circuit
GPIO.output(11, GPIO.HIGH)
GPIO.output(11, GPIO.LOW)