#!/usr/bin/python

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
  input_state = GPIO.input(21)
  if input_state == False:
    print('pressed '+time.ctime())
    time.sleep(0.2)
