Dr. Umesh DuttaVansh Mantri
Published © GPL3+

Raspberry Pi GUI Based LED Control

Demonstration of LED Control using Python GUI

IntermediateFull instructions provided2 hours4,547
Raspberry Pi GUI Based LED Control

Things used in this project

Story

Read more

Schematics

Circuit Diagram LED control using RPi

GUI based LED control

Code

LED Control Python GUI

Python
Code Runs on RPi and controls LED connected to GPIO pin 8
from tkinter import *
import RPi.GPIO as GPIO
import time


window= Tk()
window.geometry("1000x600")
window.title("ROBO TEST")

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(8,GPIO.OUT)


def on():
    GPIO.output(8, True)

def off():
    GPIO.output(8, False)
    


B1 = Button(window, text="ON", width=20, bg="yellow", fg="black", command=on)
B1.place(x=150,y=50)

B2 = Button(window, text="OFF", width=20, bg="yellow", fg="black", command=off)
B2.place(x=350,y=50)

window.mainloop()

Credits

Dr. Umesh Dutta

Dr. Umesh Dutta

38 projects • 53 followers
Working as Director of Innovation Centre at Manav Rachna, India. I am into development for the last 12 years.
Vansh Mantri

Vansh Mantri

1 project • 1 follower
Student at Delhi Public School, Faridabad

Comments