<p>It seems that <code>ULTIPANEL</code> must be defined. The code for the encoder was included long ago with the Ultipanel (display and encoder) and does not exist on its own.</p>

<pre><code>#define LCD_SAINSMART_I2C_2004   //  I2C LCD

#define ULTIPANEL                // enable code for encoder.

//encoder pins
#define BTN_EN1 37
#define BTN_EN2 35
#define BTN_ENC 31
</code></pre>

CC BY-SA 4.0
2019-09-29T18:03:40.470Z
I notice that the `BTN_ENx` definitions differ from those posted in your question. These are the correct pins I guess, or can they be set to any pins, which the encoder is connected to? Also, did you have any links, or sources, for the code having been included and now no longer exists? The statement seems a bit confused. Presumably the code is still included, but requires the `#define ULTIPANEL` to enable it?
Greenonline
CC BY-SA 4.0
2019-09-30T01:14:20.947Z
They can be to any available pin. Whatever is used, as long as it is defined the same, would work. I said the encoder code does not exist "on it's own". When the UNIPANEL became available someone wrote the code to use the complete LCD and Encoder as a set. Not as two separate components that would both have to be each selected. This is not a surprise, code grows organically, as is needed. I have not been able to locate the actual code. I got it working and didn't feel like spending more time looking for it at this time. But I do want to find it.
Rudy
CC BY-SA 4.0
2019-09-29T14:21:17.257Z
2019-09-29T17:58:31.733Z
2019-09-29T17:58:31.733Z
Rudy
<p>I am trying to configure Marlin for a Ramps 1.6 board. I have an I2C 4x20 character LCD enabled. I have the LCD working with </p>

<pre><code>#define LCD_SAINSMART_I2C_2004
</code></pre>

<p>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. </p>

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

<p>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. </p>

<pre><code>//encoder pins  
#define BTN_EN1 31 
#define BTN_EN2 33  
#define BTN_ENC 35
</code></pre>

<marlin>
Where to enable user interface encoder in Marlin?
Rudy
# Where to enable user interface encoder in Marlin?

(Asked by: username_0 on 2019-09-19)

I am trying to configure Marlin for a Ramps 1.6 board. 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

**Tags:** marlin

---

## 1 answers

### Answer by username_0 on 2019-09-29. Score: 2 | Accepted answer

It seems that ULTIPANEL must be defined. The code for the encoder was included long ago with the Ultipanel (display and encoder) and does not exist on its own.
#define LCD_SAINSMART_I2C_2004   //  I2C LCD

#define ULTIPANEL                // enable code for encoder.

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

> **Comments:**
> **username_1**: I notice that the `BTN_ENx` definitions differ from those posted in your question. These are the correct pins I guess, or can they be set to any pins, which the encoder is connected to? Also, did you have any links, or sources, for the code having been included and now no longer exists? The statement seems a bit confused. Presumably the code is still included, but requires the `#define ULTIPANEL` to enable it?  
> **username_0**: They can be to any available pin. Whatever is used, as long as it is defined the same, would work. I said the encoder code does not exist "on it's own". When the UNIPANEL became available someone wrote the code to use the complete LCD and Encoder as a set. Not as two separate components that would both have to be each selected. This is not a surprise, code grows organically, as is needed. I have not been able to locate the actual code. I got it working and didn't feel like spending more time looking for it at this time. But I do want to find it.  

---

