I got the rotary encorders today, but am hitting a first snag… apparently the way the code is written, it’s not possible to run 3 encoder readings in parallel.
First, a disclaimer… I can’t really code. I can usually piece together projects from bits and pieces of examples and existing projects.
This is what I am using as a basis: Timer.ino by noveldevices
This works by itself (I redirected all display outputs for now to serial console).
This is my code so far (had to attach is, too large to use with the code tag)… please keep in mind that it’s a complete mess at this time, since I am still experimenting and am still missing half my hardware in the first place.
I triplicated all timers, variables etc for the 3 timers.
What works: The “tea” timers appear to be working okay. Pressing the button on the rotary encoder starts and stops a countup instead of down, which is consistent with the original code when the timer is set to zero.
What doesn’t work: Reading the encoder (I currently have only one hooked up, to pins 2/3). If I use my exact code and remove all references to timers/encoders 2 and 3 and the tea timers, it starts working, so my guess is that they somehow interfere with each other, possibly due to the “while” loop. If someone could nudge me in the right direction, it’d be greatly appreciated.
I apologize for any physical and mental pain my code monster might cause.
timer.ino (13.2 KB)