Skip to content
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

polling works, but not interrupts #11

Open
thijsdeschildre opened this issue Sep 3, 2020 · 3 comments
Open

polling works, but not interrupts #11

thijsdeschildre opened this issue Sep 3, 2020 · 3 comments

Comments

@thijsdeschildre
Copy link

I can't get this to work with interrupts on an Arduino Nano (and Attiny85 ultimately). Software polling works.

Starting with the example cocde, I defined the rotary encoder with pins 8 and 9, and attached interrupts 0 and 1 to the rotate subroutine.
With software polling I measure a pullup on the rotary encoder, but not when using the interrupts. I added a pullup with a 2K resistor to 5V, which doesn't help.

@KarateBrot
Copy link

Did you declare your variables (used in the ISR) to be volatile?

@thijsdeschildre
Copy link
Author

Did you declare your variables (used in the ISR) to be volatile?

No, I just used the interrupt example as it is. Only changed the pin numbers. With my extra code, later on, this would be necessary alright.

@elijahshumway
Copy link

Use the same pins you declared Rotary on for attaching the interrupts, worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants