I have not found a easy and intuitive way to do it so far. If you have a suggestion hos to do it exactly I’d be happy to hear it.
The issue is that the attachInterrupt function needs to receive a function that is not associated with any class. And then it needs to be either static member of a class or a standalone function.
- The static function would only work for one encoder at the time.
- and with the standalone function it is only possible to do if you create it after you created the encoder class. That means in the arduino sketch.
I don’t like it etteher, but for now that is the best solution I could find.
Can you elaborate a bit more your ideas?
Also why do you think this method at the moment is too complicated, is there a practical reason when this creates problems?