Controlling a fan using Raspberry PI and GPIO
Rate this article
0 out of 5
In this tutorial we will show you how to Controlling a fan using Raspberry PI and GPIO




import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False) 
GPIO.setup(17,GPIO.OUT)
GPIO.output(17,GPIO.HIGH)
print"FAN ON"
time.sleep(2)
GPIO.output(17,GPIO.LOW)
print"FAN OFF"
time.sleep(5)
GPIO.output(17,GPIO.HIGH)
print"FAN ON"
time.sleep(3)
GPIO.output(17,GPIO.LOW)
print"FAN OFF"
GPIO.cleanup


source code

   
Messages
Posted:
Post Your Comments
Name (Max 50 Chars)
Comments

Copyright © KTS Infotech 2000-2023. Site Developed Using KTS WebCloud
Reach Us on facebookWatch Video Tutorials on YouTube Channel TekTipsNavigate to KTS Technology Blog