#
# Remember to run IDLE as sudo idle (or there will be no access to GPIO)
#
#
#Load GPIO Library (allows access to GPIO pins)
import RPi.GPIO as GPIO
#
# Load time library (allows access to functions such as sleep)
import time
#(Board means GPIO use pin numbers not the chip numbers)
GPIO.setmode(GPIO.BOARD)
#
# Set GPIO Board Pin 7 to be an output
#
GPIO.setup(7,GPIO.OUT)
#
# Set GPIO Board Pin 11 to be an input, set it to pull up on)
GPIO.setup(11,GPIO.IN)
#
# Start a loop and run it 'n' times
#
while True:
    if (GPIO.input(11) == False):
        print ("Button Pressed")
        GPIO.output(7,True)
        time.sleep(0.1)
        print ("Button NOT Pressed")
        GPIO.output(7,False)
GPIO.cleanup()

