Welcome! Log In Create A New Profile

Advanced

How / where to enable UI encoder

Posted by rudyfiero 
How / where to enable UI encoder
September 19, 2019 06:51PM
I am trying to configure Marlin for a Ramps 1.6 board on a MEGA 2560 . I have an I2C 4x20 character LCD enabled. I have the LCD working with #define LCD_SAINSMART_I2C_2004

I have a separate encoder, with push button, but I can't find where to enable it. It seems that combo display-encoder-buzzer boards are enabled as a set. Some common name, like the define I used for the display. But I can't find any useful information that includes a I2C LCD with an encoder.

I'm looking for a configuration that would enable my LCD and encoder, or just some way to enable the encoder by itself.

For some configurations I found the following. But When I connect my encoder to those pins nothing happens when I try it. So I think I need to enable them somewhere.

//encoder pins
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
Re: How / where to enable UI encoder
September 19, 2019 11:40PM
You need #define NEWPANEL and the 3 pins above defined

Edited 1 time(s). Last edit at 09/19/2019 11:41PM by Dust.
Re: How / where to enable UI encoder
September 20, 2019 01:01AM
I couldn't find an I2C LCD setup that included #define NEWPANEL

So I manually added

//encoder pins
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
#define NEWPANEL

It compiled but I get no change on the LCD when I turn the encoder or push the encoder (button). I'll try again tomorrow. (midnight now)
Re: How / where to enable UI encoder
September 20, 2019 02:31AM
looks like you also need ULTIPANEL
Re: How / where to enable UI encoder
September 21, 2019 07:48PM
It's working. The LCD works through I2C and the encoder is working through port pins.
I included the following, with and without NEWPANEL defined.

#define ULTIPANEL    
//#define NEWPANEL

//encoder pins 
#define BTN_EN1 37
#define BTN_EN2 35
#define BTN_ENC 31

I did have a problem where I had to turn the encoder four clicks to produce one step. I had to set the following to 1, although it seemed the default should have been 1.

#define ENCODER_PULSES_PER_STEP 1

There still is something wacky. When I select a selection, I get the item below it. Like if I want to move the X axis, I select that, but the selection then put me into the Y axis screen.

If I set the fan speed to 60, after clicking pushing enter to accept the 60, 59 is displayed as the current value.

EDIT:

I think it has something to do with the kind of encoder I am using. To reduce the problems I have to set
#define ENCODER_PULSES_PER_STEP 2
and that gets rid of the worst of the problems. I have to turn the encoder twice as much for some things, but I can end up when I need to go.

Edited 3 time(s). Last edit at 09/21/2019 08:05PM by rudyfiero.
Sorry, only registered users may post in this forum.

Click here to login