blob: 72f54f0ccd96e7ef47bde6989966f90a0458157f [file] [log] [blame]
White Moustachec4642612016-02-13 14:17:08 +00001import wiringpi2
2PIN_TO_SENSE = 23
3
4def gpio_callback():
5 print "GPIO_CALLBACK!"
6
7wiringpi2.wiringPiSetupGpio()
8wiringpi2.pinMode(PIN_TO_SENSE, wiringpi2.GPIO.INPUT)
9wiringpi2.pullUpDnControl(PIN_TO_SENSE, wiringpi2.GPIO.PUD_UP)
10
11wiringpi2.wiringPiISR(PIN_TO_SENSE, wiringpi2.GPIO.INT_EDGE_BOTH, gpio_callback)
12
13while True:
14 wiringpi2.delay(2000)