vsergeev / python-periphery

A pure Python 2/3 library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.
MIT License
529 stars 139 forks source link

Example for using poll? #5

Closed 9600 closed 7 years ago

9600 commented 8 years ago

Do you have an example of using GPIO with poll? I'm trying to use this on an Intel Edison, have set edge to falling and no matter what parameter I pass to poll it always immediately returns with True, despite the state of the pin in question not having changed.

I can otherwise read and set pin states fine.

vsergeev commented 8 years ago

There's a few examples of poll in the hardware tests here: https://github.com/vsergeev/python-periphery/blob/v1.0.0/tests/test_gpio.py#L100

Does a read followed by poll work?

jakogut commented 7 years ago

@9600: I experienced the same issue, and I made a pull request to fix it.

vsergeev commented 7 years ago

@jakogut thanks! I'll be updating python-periphery this week with the pending PRs and a new release.

jakogut commented 7 years ago

@vsergeev Very cool, I'm glad to hear that such a useful library is still being maintained.