led with raspberry pi

8

Upload: maryala-srinivas

Post on 30-Aug-2014

762 views

Category:

Business


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Led with raspberry pi
Page 2: Led with raspberry pi
Page 3: Led with raspberry pi
Page 4: Led with raspberry pi
Page 5: Led with raspberry pi

LED PROGRAMME

import RPi.GPIO as GPIO pinNum = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(17,GPIO.OUT) GPIO.output(17,GPIO.HIGH) GPIO.output(17,GPIO.LOW)

Page 6: Led with raspberry pi

LED PROGRAMME(CONTINEOUS)

import RPi.GPIO as GPIO import time pinNum = 8 GPIO.setmode(GPIO.BCM) GPIO.setup(8,GPIO.OUT) while True: GPIO.output(8,GPIO.HIGH) time.sleep(0.5) GPIO.output(8,GPIO.LOW) time.sleep(0.5)

Page 7: Led with raspberry pi

LED INTERFACING USING ONE SWITCH

Page 8: Led with raspberry pi

import RPi.GPIO as GPIO import time pinNum = 8 pinNum = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(8,GPIO.OUT) GPIO.setup(17,GPIO.IN) Input=GPIO.input(17) while True: if(GPIO.input(17)):  GPIO.output(8,GPIO.HIGH) time.sleep(0.5) GPIO.output(8,GPIO.LOW) time.sleep(0.5)