#!/usr/bin/python import time import RPi.GPIO as GPIO GPIO.setup(11, GPIO.IN) count = 0 while True: mybutton = GPIO.input(11) if mybutton == False: count = count+1 print "count", count time.sleep(.2)