Rotary Encoder, Button, and LCD User interface with Menu

vangalvin:
Do you by any chance have an example that uses the LiquidCrystal.h library and an LCD without a shift register?

Changes
Defines.h

#define NUM_LCD_ROWS 4
#define NUM_LCD_COLS 20

REBLDisplay.h

#include "REBLDisplay.h"

#ifdef USING_SERIAL
extern HardwareSerial Serial;
#endif

LiquidCrystal *LCD;

uint8_t redPin;
uint8_t greenPin;
uint8_t bluePin;


char lineBuffer[NUM_LCD_ROWS][NUM_LCD_COLS + 1]; // Leave an extra space for terminating null

color_vars current_color;

boolean cursorActive = false;
uint8_t cursorRow;
uint8_t cursorCol;

void initLCD(uint8_t aRsPin, uint8_t aEnablePin, uint8_t aD1, uint8_t aD2, uint8_t aD3, uint8_t aD4) {

#ifdef USING_SERIAL
   Serial.begin(19200);
#else
   LCD = new LiquidCrystal(aRsPin, aEnablePin, aD1, aD2, aD3, aD4);
   LCD->begin(NUM_LCD_COLS, NUM_LCD_ROWS);
   LCD->noCursor();
   LCD->clear();

#endif
}

REBL_UI_Example

#include <LiquidCrystal>
#define ENCODER_INTERRUPT_PIN 2 // MUST keep pin 2.
#define ENCODER_B_PIN A0
#define BUTTON_PIN A1
#define LCD_ENABLE_PIN 13
#define LCD_RS_PIN 12
#define HEART_BEAT_PIN A15
//#define LCD_BLUE A0
//#define LCD_GREEN A2
//#define LCD_RED A4
#define LCD_D1 5    // New ↓
#define LCD_D2 4
#define LCD_D3 3
#define LCD_D4 7
const int contrast = 20;    // min. PWM value

void setup() [Replace everything in the curly braces.]

initLCD(LCD_RS_PIN, LCD_ENABLE_PIN, LCD_D1, LCD_D2, LCD_D3, LCD_D4); // New
  initInterface(BUTTON_PIN, ENCODER_INTERRUPT_PIN, ENCODER_B_PIN);
  reblMenu.setCurrentMenu(&menuList);
  pinMode(8,HIGH);  // LCD pin 15: backlight (anode)
//  pinMode(11,OUTPUT);
//  analogWrite(11,700);
  analogWrite(6,contrast); // PWM~ pins: 3,5,(6),9,10,11. LCD pin 3: Vo (supply for LCD driver)
// Turn on LCD Backlight:
//    lcd.setLED1Pin(1);

Or you can try out the above from this link: github.com/adamaero/REBL_UI

It finally works. The schematic is for the Mega 2560. But it only shows up on half of the LCD (2x16 instead of 4x20). So I think something in "REBLDisplay.cpp" around line 85ish and down would be the change...

pinoutLCD.PNG