suresh sarika
Published © TAPR-OHL

On/Off any Electronic Device from Anywhere.

In a changing world everything happening automatically. So why don't we control our surroundings automatically. Here is the simple example.

IntermediateProtip2,280
On/Off any Electronic Device from Anywhere.

Things used in this project

Story

Read more

Schematics

On/Off bulb

On/Off Bulb using raspberry pi

Code

On/Off Lights using raspberry pi

Python
import RPi.GPIO as GPIO       	# Import required Python libraries
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)
from Tkinter import*
myGui=Tk()
while True:
	def onlamp():
		GPIO.output(7,True)
	def offlamp():
		GPIO.output(7,False)
	myGui.title("Hello")
	myGui.geometry("200x350+200+200")
	while True:
		myButton1=Button(text='on',fg='black',bg='green',command=onlamp).pack()
		myButton2=Button(text='off',fg='black',bg='green',command=offlamp).pack()
		myGui.mainloop()
	

Credits

suresh sarika

suresh sarika

3 projects • 7 followers

Comments