User Tools

Site Tools


gpio_inputs_-_button_led_control_using_an_interrupt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
gpio_inputs_-_button_led_control_using_an_interrupt [2016/08/09 22:58] walkeradmingpio_inputs_-_button_led_control_using_an_interrupt [2016/08/09 23:00] walkeradmin
Line 25: Line 25:
         print "Button is Pressed"  # print something to the screen         print "Button is Pressed"  # print something to the screen
         GPIO.output(12,1)          # set GPIO pin 12 to high (3.3v) so LED will come on         GPIO.output(12,1)          # set GPIO pin 12 to high (3.3v) so LED will come on
-     + 
-    GPIO.add_event_detect(11, GPIO.RISING, callback=buttonPressed, bouncetime=500)    # this is where we setup the GPIO input +    # this is where we setup the GPIO input to use the event buttonPressed that was 
-                                                                                      # to use the event buttonPressed that was +    # defined previously. bouncetime is a simple switch debouncer in mS. 
-                                                                                      # defined previously. bouncetime is a simp$ +    GPIO.add_event_detect(11, GPIO.RISING, callback=buttonPressed, bouncetime=500)    
-                                                                                      # switch debouncer in mS.+
          
     GPIO.setup(12, GPIO.OUT)   # Sets the GPIO pin as output. This is connected to the LED, then     GPIO.setup(12, GPIO.OUT)   # Sets the GPIO pin as output. This is connected to the LED, then