from Tkinter import *
import RPi.GPIO as GPIO
import tkFont





GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(14, GPIO.OUT)
GPIO.setup(15, GPIO.OUT)
GPIO.setup(23, GPIO.OUT)

def led1():

  if GPIO.input(18):

	 GPIO.output(18, GPIO.LOW)
	
  else:

         GPIO.output(18, GPIO.HIGH)

def led2():

  if GPIO.input(14):

	 GPIO.output(14, GPIO.LOW)

  else:

         GPIO.output(14, GPIO.HIGH)

def led3():

  if GPIO.input(15):

	 GPIO.output(15, GPIO.LOW)

  else:

         GPIO.output(15, GPIO.HIGH)

def led4():

  if GPIO.input(23):

	 GPIO.output(23, GPIO.LOW)

  else:

         GPIO.output(23, GPIO.HIGH)


root = Tk()
root.geometry("1024x600")
root.title("Nikodem Bartnik")

buttonFont = tkFont.Font(family = 'Arial', size = 20, weight = 'bold')

toggleButton1 = Button(root, text = "LED 1", font = buttonFont, width = 15, height = 10, command = led1)
toggleButton1.pack(side = LEFT)

toggleButton2 = Button(root, text = "LED 2", font = buttonFont, width = 15, height = 10, command = led2)
toggleButton2.pack(side = LEFT)

toggleButton3 = Button(root, text = "LED 3",font = buttonFont, width = 15, height = 10, command = led3)
toggleButton3.pack(side = LEFT)

toggleButton4 = Button(root, text = "LED 4",font = buttonFont, width = 15, height = 10, command = led4)
toggleButton4.pack(side = LEFT)

root.mainloop()



