import RPi.GPIO as GPIO ## Import GPIO library
import time


GPIO.setmode(GPIO.BOARD) ## Use board pin numbering
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(16, GPIO.OUT) ## Setup GPIO Pin 16 to OUT

while 1:
 if GPIO.input(18):
  print "Nic se nedeje"
  GPIO.output(16, False)
  time.sleep(0.2)
 else:
 # When the button switch is not pressed, turn off the LED.
  print "Nekdo prisel, svitime!"
  GPIO.output( 16, True)
  time.sleep(0.2)
