Jomelo / LCDMenuLib2

Create a tree menu. Use it with different lcd types / console output / ssh console.
MIT License
249 stars 47 forks source link

Teensy 3.2 / LCDMenuLib2 / Rotary Encoder Interrupts #47

Closed medienverbinder closed 5 years ago

medienverbinder commented 5 years ago

I tried the LCDMenuLib2 example with an Oled Display and rotary Encoder on a Teensy 3.2. (Arduino IDE 1.8.9/Tinsyduino 1.46)

Unfortunately the variant on the Teensy only works if I switch off the interrupts (>> here <<):

=> //#define ENCODER_OPTIMIZE_INTERRUPTS => #define ENCODER_DO_NOT_USE_INTERRUPTS

(with a small change from Encoder Issue #40, the example on Node MCU (ESP 8266) works.)

I'm not sure where the error is, so there is also a corresponding issue on the Encoder GitHub page:

=> https://github.com/PaulStoffregen/Encoder/issues/41

Does anyone know a workaround so that the interrupts can be used or does anyone have a suggestion why the navigation doesn't work anymore when the interrupts are activated?

Zefram88 commented 5 years ago

I've solved commenting those two lines: //pinMode(encoder_A_pin , INPUT_PULLUP); //pinMode(encoder_B_pin , INPUT_PULLUP);

Now encoder with interrupts works

medienverbinder commented 5 years ago

@Zefram88 Thanks for the tip, now everything works. I have adjusted the following settings:

`

define ENCODER_USE_INTERRUPTS

define ENCODER_OPTIMIZE_INTERRUPTS //Only when using pin2/3 (yes, I use them. :-) )

//pinMode(encoder_A_pin , INPUT_PULLUP); //pinMode(encoder_B_pin , INPUT_PULLUP); `

medienverbinder commented 5 years ago

Closed