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

using millis() in ultrasonic sensor program in tamil

RFID attendance system review in tamil

CHATBOT programming tutorial in tamil