blob: 175482a91750e7bc4049852598a70d5568fc255e [file] [log] [blame]
Phil Howard6577b7e2016-03-09 12:19:22 +00001import wiringpi
White Moustachec4642612016-02-13 14:17:08 +00002PIN_TO_SENSE = 23
3
4def gpio_callback():
5 print "GPIO_CALLBACK!"
6
Phil Howard6577b7e2016-03-09 12:19:22 +00007wiringpi.wiringPiSetupGpio()
8wiringpi.pinMode(PIN_TO_SENSE, wiringpi.GPIO.INPUT)
9wiringpi.pullUpDnControl(PIN_TO_SENSE, wiringpi.GPIO.PUD_UP)
White Moustachec4642612016-02-13 14:17:08 +000010
Phil Howard6577b7e2016-03-09 12:19:22 +000011wiringpi.wiringPiISR(PIN_TO_SENSE, wiringpi.GPIO.INT_EDGE_BOTH, gpio_callback)
White Moustachec4642612016-02-13 14:17:08 +000012
13while True:
Phil Howard6577b7e2016-03-09 12:19:22 +000014 wiringpi.delay(2000)