Welcome! Log In Create A New Profile

Advanced

rotary encoder

Posted by themathaias 
rotary encoder
March 04, 2023 12:00PM
hey guys,

i have a small problem with a rotary encoder of wich the press button skips between menu's

i posted this problem earlier on the wrong subforum, and someone told me it coud be becaus there is no pullup resistor.

is there a way to enable 1 in marlin?
or shoud i add one to the hardware?

thanks already!
Re: rotary encoder
March 04, 2023 05:08PM
Sounds like your encoder is wearing out.

Adding a hardware pullup resistor may help.

Depending on what CPU is on your motherboard, you can add a pullup via firmware. Try adding this to the pins_YOUR_BOARD.h file:
#define BOARD_PREINIT() SET_INPUT_PULLUP(xxx)  // xxx is the pin number of BTN_ENC pin.
Re: rotary encoder
March 05, 2023 07:18AM
i think it helped a little against the automatic clicking,
i had that a few times and since i uploaded the code it doesnt do that anymore so big thankyou!

but the problem for the menu is still there, it just seems like it clicks too fast or always twice when i push once?

becaus i can scroll trough the menus when i keep pushing it in and then time the release on the other menu so it clicks once more to the one i want to open

the cpu is a ramps1.4 with a arduino mega btw, i forgot to mention that

also, can i ask you where you found that code? is there a file where its all in? or is it just experience?

again thanks for the help!
Re: rotary encoder
March 05, 2023 11:54AM
You can also enable ENCODER_NOISE_FILTER and play with ENCODER_SAMPLES to see if you can get reliable operation.

I've been playing with Marlin code for a long time and answering questions in the support forums for a long time. I came up with this because of my varied experiences with Marlin.
Re: rotary encoder
March 07, 2023 06:19AM
i tried putting the ENCODER_SAMPLES to 10,40 and 5 but it didnt really change anything
Sorry, only registered users may post in this forum.

Click here to login