From eda95d8beda548f5eaffe902ff972b9f1baa5007 Mon Sep 17 00:00:00 2001 From: CoderSquirrel Date: Sat, 19 Mar 2016 18:25:51 -0400 Subject: [PATCH] Add support for LCM1602 16x2 I2C LCD adapter --- .travis.yml | 5 +++++ Marlin/Configuration.h | 2 ++ Marlin/Marlin.ino | 4 ++++ Marlin/ultralcd_implementation_hitachi_HD44780.h | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8e20db2a49..babda87b9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -150,6 +150,11 @@ script: - sed -i 's/\/\/#define LCD_I2C_VIKI/#define LCD_I2C_VIKI/g' Marlin/Configuration.h - rm -rf .build/ - DISPLAY=:1.0 ~/bin/arduino --verify --board marlin:avr:mega Marlin/Marlin.ino + # LCM1602 + - cp Marlin/Configuration.h.backup Marlin/Configuration.h + - sed -i 's/\/\/#define LCM1602/#define LCM1602/g' Marlin/Configuration.h + - rm -rf .build/ + - DISPLAY=:1.0 ~/bin/arduino --verify --board marlin:avr:mega Marlin/Marlin.ino # Enable filament sensor - cp Marlin/Configuration.h.backup Marlin/Configuration.h - sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bb8b8ba265..06d45ffedf 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -754,6 +754,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l //#define LCD_I2C_SAINSMART_YWROBOT +//#define LCM1602 // LCM1602 Adapter for 16x2 LCD + // PANELOLU2 LCD with status LEDs, separate encoder and click inputs // // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 ) diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 09e73dcc18..7450ee1fd0 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -40,6 +40,10 @@ #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008) #include #include + #elif ENABLED(LCM1602) + #include + #include + #include #elif ENABLED(DOGLCD) #include // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/) #else diff --git a/Marlin/ultralcd_implementation_hitachi_HD44780.h b/Marlin/ultralcd_implementation_hitachi_HD44780.h index e12ec2d8f0..8a033afbe6 100644 --- a/Marlin/ultralcd_implementation_hitachi_HD44780.h +++ b/Marlin/ultralcd_implementation_hitachi_HD44780.h @@ -183,6 +183,12 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #include #define LCD_CLASS LiquidCrystal_SR LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN); +#elif ENABLED(LCM1602) + #include + #include + #include + #define LCD_CLASS LiquidCrystal_I2C + LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); #else // Standard directly connected LCD implementations #include