#Python script that displays status of all GPIO
#ports on PI, useful for "debugging" wiring

import RPi.GPIO as GPIO

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
#GPIO.setmode(GPIO.BOARD) another method of addressing GPIO

GPIO.setup(2, GPIO.IN)
#empty
GPIO.setup(3, GPIO.IN)
#empty
GPIO.setup(4, GPIO.IN)
GPIO.setup(14, GPIO.IN)
GPIO.setup(15, GPIO.IN)
GPIO.setup(17, GPIO.IN)
GPIO.setup(18, GPIO.IN)
#empty
GPIO.setup(27, GPIO.IN)
GPIO.setup(22, GPIO.IN)
GPIO.setup(23, GPIO.IN)
#empty
GPIO.setup(24, GPIO.IN)
GPIO.setup(10, GPIO.IN)
#empty
GPIO.setup(9, GPIO.IN)
GPIO.setup(25, GPIO.IN)
GPIO.setup(11, GPIO.IN)
GPIO.setup(8, GPIO.IN)
#empty
GPIO.setup(7, GPIO.IN)

print ' pin01  _____: {0}   {1} :_____  pin02'.format('3V', '5V')
print ' pin03  GPIO2: {0}    {1} :_____  pin04'.format(GPIO.input(2), '5V')
print ' pin05  GPIO3: {0}    {1} :_____  pin05'.format(GPIO.input(3), '5V')
print ' pin07  GPIO4: {0}    {1}  :GPIO14 pin08'.format(GPIO.input(4), GPIO.input(14))
print ' pin09  __GND: {0}    {1}  :GPIO15 pin10'.format(' ', GPIO.input(15))
print ' pin11 GPIO17: {0}    {1}  :GPIO18 pin12'.format(GPIO.input(17), GPIO.input(18))
print ' pin13 GPIO27: {0}    {1}  :GND___ pin14'.format(GPIO.input(27), ' ')
print ' pin15 GPIO22: {0}    {1}  :GPIO23 pin16'.format(GPIO.input(22), GPIO.input(23))
print ' pin17 ______: {0}   {1}  :GPIO24 pin18'.format('3V', GPIO.input(24))
print ' pin19 GPIO10: {0}    {1}  :GND___ pin20'.format(GPIO.input(10), ' ')
print ' pin21 GPIO09: {0}    {1}  :GPIO25 pin22'.format(GPIO.input(9), GPIO.input(25))
print ' pin22 GPIO11: {0}    {1}  :GPIO08 pin23'.format(GPIO.input(11), GPIO.input(8))
print ' pin24  __GND: {0}    {1}  :GPIO07 pin25'.format(' ', GPIO.input(7))

GPIO.cleanup()
