neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
929 stars 189 forks source link

Rotary Encoder problem on STM32 BluePill #438

Closed lucky62 closed 1 month ago

lucky62 commented 1 month ago

Hello, I am quite struggling with this library and encoder on STM32 BluePill. The main problem is with encoder.

ClickEncoder Library is only for AVR. Frorm ClickEncoder.h:

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

I am trying to use menuIO/encoderIn.h, but it is always failing. I tried this definition of pins:

#define ENC_A PB12
#define ENC_B PB13

And also this:

unsigned char ENC_A  = PB12;
unsigned char ENC_B  = PB13;

In all cases I got the error like this: image

What is wrong?

Alternatives: I have two other encoder libraries which are working on STM32: Encoder from Paul Stoffregen and ESPRotary from Lennart Hennings

In all cases the separate handling is required for built-in encoder button. I cannot find how to "connect " the encoder and button with Menu.

Please help.

lucky62 commented 1 month ago

I found the solution here.