raspberry gpio tutorial 2.. getting input using switch in tamil

python codings

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.IN)
while 1:
    if GPIO.input(17):
        print 'button pressed'
        time.sleep(1)
    else:
        print 'button not pressed'
        time.sleep(1)
        
***************************************************************************************************************
copy that and paste in your python idle




Comments

Popular posts from this blog

how to make pic and pot robot (robotic arm) in tamil

RFID attendance system review in tamil

Arduino - millis() in tamil