Browse Source

Add support for LCM1602 16x2 I2C LCD adapter

CoderSquirrel 8 years ago
parent
commit
eda95d8bed
4 changed files with 17 additions and 0 deletions
  1. 5
    0
      .travis.yml
  2. 2
    0
      Marlin/Configuration.h
  3. 4
    0
      Marlin/Marlin.ino
  4. 6
    0
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 5
- 0
.travis.yml View File

150
   - sed -i 's/\/\/#define LCD_I2C_VIKI/#define LCD_I2C_VIKI/g' Marlin/Configuration.h
150
   - sed -i 's/\/\/#define LCD_I2C_VIKI/#define LCD_I2C_VIKI/g' Marlin/Configuration.h
151
   - rm -rf .build/
151
   - rm -rf .build/
152
   - DISPLAY=:1.0 ~/bin/arduino --verify --board marlin:avr:mega  Marlin/Marlin.ino
152
   - DISPLAY=:1.0 ~/bin/arduino --verify --board marlin:avr:mega  Marlin/Marlin.ino
153
+  # LCM1602
154
+  - cp Marlin/Configuration.h.backup Marlin/Configuration.h
155
+  - sed -i 's/\/\/#define LCM1602/#define LCM1602/g' Marlin/Configuration.h
156
+  - rm -rf .build/
157
+  - DISPLAY=:1.0 ~/bin/arduino --verify --board marlin:avr:mega  Marlin/Marlin.ino
153
   # Enable filament sensor
158
   # Enable filament sensor
154
   - cp Marlin/Configuration.h.backup Marlin/Configuration.h
159
   - cp Marlin/Configuration.h.backup Marlin/Configuration.h
155
   - sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h
160
   - sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h

+ 2
- 0
Marlin/Configuration.h View File

754
 
754
 
755
 //#define LCD_I2C_SAINSMART_YWROBOT
755
 //#define LCD_I2C_SAINSMART_YWROBOT
756
 
756
 
757
+//#define LCM1602 // LCM1602 Adapter for 16x2 LCD
758
+
757
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
759
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
758
 //
760
 //
759
 // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
761
 // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )

+ 4
- 0
Marlin/Marlin.ino View File

40
   #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
40
   #elif ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)
41
     #include <Wire.h>
41
     #include <Wire.h>
42
     #include <LiquidTWI2.h>
42
     #include <LiquidTWI2.h>
43
+  #elif ENABLED(LCM1602)
44
+    #include <Wire.h>
45
+    #include <LCD.h>
46
+    #include <LiquidCrystal_I2C.h>
43
   #elif ENABLED(DOGLCD)
47
   #elif ENABLED(DOGLCD)
44
     #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
48
     #include <U8glib.h> // library for graphics LCD by Oli Kraus (https://code.google.com/p/u8glib/)
45
   #else
49
   #else

+ 6
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

183
   #include <LiquidCrystal_SR.h>
183
   #include <LiquidCrystal_SR.h>
184
   #define LCD_CLASS LiquidCrystal_SR
184
   #define LCD_CLASS LiquidCrystal_SR
185
   LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN);
185
   LCD_CLASS lcd(SR_DATA_PIN, SR_CLK_PIN);
186
+#elif ENABLED(LCM1602)
187
+  #include <Wire.h>
188
+  #include <LCD.h>
189
+  #include <LiquidCrystal_I2C.h>
190
+  #define LCD_CLASS LiquidCrystal_I2C
191
+  LCD_CLASS lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
186
 #else
192
 #else
187
   // Standard directly connected LCD implementations
193
   // Standard directly connected LCD implementations
188
   #include <LiquidCrystal.h>
194
   #include <LiquidCrystal.h>

Loading…
Cancel
Save