Updated for LiquidTWI2 library version 1.2.3
The new version of the library means that PANELOLU no longer needs to be defined in LiquidTWI.h (the library file can be used as is) and the new version of the library also enables the buzzer on the Panucatt VIKI panel.
This commit is contained in:
parent
7bad72359c
commit
9322c408c6
|
@ -348,11 +348,12 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
|
||||||
#define ULTIPANEL
|
#define ULTIPANEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
||||||
//#define LCD_I2C_PANELOLU2
|
//#define LCD_I2C_PANELOLU2
|
||||||
#ifdef LCD_I2C_PANELOLU2
|
#ifdef LCD_I2C_PANELOLU2
|
||||||
// This uses the LiquidTWI2 library ( https://github.com/lincomatic/LiquidTWI2 )
|
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
||||||
// Make sure it is placed in the Arduino or Sketchbook libraries directory.
|
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
||||||
|
// (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
|
||||||
// Note: The PANELOLU2 encoder click input can either be directly connected to a pin
|
// Note: The PANELOLU2 encoder click input can either be directly connected to a pin
|
||||||
// (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
|
// (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).
|
||||||
#define LCD_I2C_TYPE_MCP23017
|
#define LCD_I2C_TYPE_MCP23017
|
||||||
|
@ -362,15 +363,16 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
|
||||||
#define ULTIPANEL
|
#define ULTIPANEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
||||||
//#define LCD_I2C_VIKI
|
//#define LCD_I2C_VIKI
|
||||||
#ifdef LCD_I2C_VIKI
|
#ifdef LCD_I2C_VIKI
|
||||||
// This uses the LiquidTWI2 library ( https://github.com/lincomatic/LiquidTWI2 )
|
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
||||||
// Make sure it is placed in the Arduino or Sketchbook libraries directory.
|
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
||||||
// Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
// Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
||||||
// BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
// BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
||||||
#define LCD_I2C_TYPE_MCP23017
|
#define LCD_I2C_TYPE_MCP23017
|
||||||
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
||||||
|
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
|
||||||
#define NEWPANEL
|
#define NEWPANEL
|
||||||
#define ULTIPANEL
|
#define ULTIPANEL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,9 +40,6 @@
|
||||||
#elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)
|
#elif defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include <LiquidTWI2.h>
|
#include <LiquidTWI2.h>
|
||||||
#if defined(LCD_I2C_PANELOLU2) && !defined(PANELOLU2)
|
|
||||||
#error You must uncomment "#define PANELOLU2" in LiquidTWI2.h for LiquidTWI2.cpp to compile correctly
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#include <LiquidCrystal.h>
|
#include <LiquidCrystal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -54,11 +54,11 @@ extern volatile uint8_t buttons; //the last checked buttons in a bit array.
|
||||||
#define LCD_HAS_SLOW_BUTTONS
|
#define LCD_HAS_SLOW_BUTTONS
|
||||||
|
|
||||||
#elif defined(LCD_I2C_PANELOLU2)
|
#elif defined(LCD_I2C_PANELOLU2)
|
||||||
|
// encoder click can be read through I2C if not directly connected
|
||||||
#if !defined(BTN_ENC) || BTN_ENC == -1
|
#if !defined(BTN_ENC) || BTN_ENC == -1
|
||||||
// encoder click is connected through I2C (rather than directly connected)
|
|
||||||
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
#define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
|
||||||
|
|
||||||
#define B_MI (ENCODER_C<<B_I2C_BTN_OFFSET)
|
#define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
|
||||||
|
|
||||||
#define LCD_CLICKED (buttons&B_MI)
|
#define LCD_CLICKED (buttons&B_MI)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue