From 46ff301e259b2befa0f83b1be9fdc7e8bdb183e4 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Tue, 23 Aug 2011 19:12:03 -0400 Subject: [PATCH] write(), print(), and println() now return number of bytes written. The type is long, and negative values indicate errors. Needs more testing. http://code.google.com/p/arduino/issues/detail?id=551 --- LiquidCrystal.cpp | 3 ++- LiquidCrystal.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LiquidCrystal.cpp b/LiquidCrystal.cpp index 04d0f50..53119df 100644 --- a/LiquidCrystal.cpp +++ b/LiquidCrystal.cpp @@ -258,8 +258,9 @@ inline void LiquidCrystal::command(uint8_t value) { send(value, LOW); } -inline void LiquidCrystal::write(uint8_t value) { +inline long LiquidCrystal::write(uint8_t value) { send(value, HIGH); + return 1; // assume sucess } /************ low level data pushing commands **********/ diff --git a/LiquidCrystal.h b/LiquidCrystal.h index f66ec1b..2788fe0 100755 --- a/LiquidCrystal.h +++ b/LiquidCrystal.h @@ -79,7 +79,7 @@ public: void createChar(uint8_t, uint8_t[]); void setCursor(uint8_t, uint8_t); - virtual void write(uint8_t); + virtual long write(uint8_t); void command(uint8_t); private: void send(uint8_t, uint8_t);