-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Using PulseIn to detect pin interrupts #1072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@tannewt and I discussed this. He suggested that we add a We would like to implement interrupts, but doing interrupt handlers is a big topic (storage management, etc.). There's the MicroPython model but we'd like something more beginner-friendly. |
Yeah I think a value property could do it. If I haven't seen any pulses since init, I can just check the value to catch that first edge. I forgot about pull up, can we add a pull property as well or a kw arg to the contructor? |
I don't think the samd can pull up when EXTI is active because the pinmux is enabled. |
It looks like @BitKnitting makes it work: |
@notro I'm skeptical the pull up will actually work. Feel free to try it though. |
Wouldn't a |
|
I'm trying to emulate an MCP23008 (I2C I/O Expander) and for that I need pin interrupts.
pulseio.PulseIn almost gives me what I need.
All I need to know is:
These are the problems I face with PulseIn:
Adding an edge counter to PulseIn would solve these problems (counter will be cleared on read).
It would also be nice to have a
PulseIn.pinvalue
or something.Or would it be better to just implement proper pin interrupts?
The text was updated successfully, but these errors were encountered: