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:
25d81c98e4

Without this patch the LCD shows only the first charater of a string.
master
Cristian Maglie 9 years ago
parent 24a5d3a28b
commit 143b5a1cb3
  1. 4
      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){}

Loading…
Cancel
Save