using GPIO to control raspberry picamera with push button
Question: 
    import time
    import os
    import RPi.GPIO as GPIO
    
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(23 , GPIO.IN)
    
    while True:
    if GPIO.input(23)==1:
        os.system('raspistill -o image.jpg')
        os.system(‘gpicview image.jpg &’)
        sleep(20)
        os.system(‘killall gpicview’)
    else:
        print "Ready to take picture"
    GPIO.cleanup()
    

Dear friends I'm trying to control raspberry picamera with a button.. like
when i press the button it should take a picture. I configured GPIO pins also
button when I press button nothing is working, however picamera taking photo
itself. How can i make it work with button? any experts on python can guide
me? thanks!


Answer: Hardware doesn't give us a clean 1 or 0, it bounces back and forth a bit.
Check this code for "debouncing" the button:

<https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/buttons_and_switches/>

