Update multiple_encoders.ino #44
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current example for the multiple encoders reads a button pressed every time the encoder moves. Simply putting the check for the button press before the encoder position check solved that problem. The button pressed is only detected now when it is actually pressed rather than whenever the encoder is rotated. I'm not sure why this is so but it must have something to do with the seesaw picking it that pin as being pulled to ground for some reason. I can't really explain why it makes a difference, I only know that it didn't work before but now it does.
Also, on the single encoder example, the button read is before the position read and it also does not have this problem. But if you switch it to after it does exhibit the same problem.
I tested using a Trinket M0 and Feather Huzzah ESP8266.