Adafruit_Seesaw
Adafruit_Seesaw copied to clipboard
Update multiple_encoders.ino
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.