Bläddra i källkod

Add support for LCM1602 16x2 I2C LCD adapter

CoderSquirrel 8 år sedan
förälder
incheckning
eda95d8bed
4 ändrade filer med 17 tillägg och 0 borttagningar
  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 Visa fil

@@ -150,6 +150,11 @@ script:
150 150
   - sed -i 's/\/\/#define LCD_I2C_VIKI/#define LCD_I2C_VIKI/g' Marlin/Configuration.h
151 151
   - rm -rf .build/
152 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 158
   # Enable filament sensor
154 159
   - cp Marlin/Configuration.h.backup Marlin/Configuration.h
155 160
   - sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h

+ 2
- 0
Marlin/Configuration.h Visa fil

@@ -754,6 +754,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
754 754
 
755 755
 //#define LCD_I2C_SAINSMART_YWROBOT
756 756
 
757
+//#define LCM1602 // LCM1602 Adapter for 16x2 LCD
758
+
757 759
 // PANELOLU2 LCD with status LEDs, separate encoder and click inputs
758 760
 //
759 761
 // This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )

+ 4
- 0
Marlin/Marlin.ino Visa fil

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

+ 6
- 0
Marlin/ultralcd_implementation_hitachi_HD44780.h Visa fil

@@ -183,6 +183,12 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
183 183
   #include <LiquidCrystal_SR.h>
184 184
   #define LCD_CLASS LiquidCrystal_SR
185 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 192
 #else
187 193
   // Standard directly connected LCD implementations
188 194
   #include <LiquidCrystal.h>

Laddar…
Avbryt
Spara