Data Sheet

UCTRONICS Ultimate Starter Leaning Kit for Raspberry Pi #K0064
53 www.uctronics.com
connector or change your code.
The second numbering system is the BCM(GPIO.BCM) numbers. This is a lower level way of
working - it refers to the channel numbers on the Broadcom SOC. You have to always work
with a diagram of which channel number goes to which pin on the RPi board. Your script
could break between revisions of Raspberry Pi boards.
GPIO.setup(channel, mode)
This sets every channel you are using as an input(GPIO.IN) or an output(GPIO.OUT).
GPIO.output(channel, state)
This sets the output state of a GPIO pin. Where channel is the channel number based on the
numbering system you have specified (BOARD or BCM). State can be 0 / GPIO. LOW / False
or 1 / GPIO. HIGH / True.
GPIO.cleanup( )
At the end any program, it is good practice to clean up any resources you might have used.
This is no different with RPi.GPIO. By returning all channels you have used back to inputs with
no pull up/down, you can avoid accidental damage to your RPi by shorting out the pins.
Note that this will only clean up GPIO channels that your script has used. Note that
GPIO.cleanup () also clears the pin numbering system in use.