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

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