From 143b5a1cb34be3297b6185c58a218779499a2d67 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 13 Nov 2015 12:59:12 +0100 Subject: [PATCH] Fix incorrect Print.write() return value. The write method must return the number of byte successfully written (1 in this case). This fixes the library with the latest AVR core that stops writing on error: https://github.com/arduino/Arduino/commit/25d81c98e4fc1c0f5005a5ab5c63ca060c968f14 Without this patch the LCD shows only the first charater of a string. --- LiquidCrystal_I2C.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LiquidCrystal_I2C.cpp b/LiquidCrystal_I2C.cpp index 23bc50c..79f4389 100644 --- a/LiquidCrystal_I2C.cpp +++ b/LiquidCrystal_I2C.cpp @@ -9,7 +9,7 @@ #define printIIC(args) Wire.write(args) inline size_t LiquidCrystal_I2C::write(uint8_t value) { send(value, Rs); - return 0; + return 1; } #else @@ -312,4 +312,4 @@ void LiquidCrystal_I2C::draw_horizontal_graph(uint8_t row, uint8_t column, uint8 void LiquidCrystal_I2C::draw_vertical_graph(uint8_t row, uint8_t column, uint8_t len, uint8_t pixel_row_end){} void LiquidCrystal_I2C::setContrast(uint8_t new_val){} - \ No newline at end of file +