From 2c32369685d38f7367328d470571dd2f9a1104c7 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sun, 4 Jul 2010 23:22:34 +0000 Subject: Adding support for printing Strings to the Print class. --- cores/arduino/Print.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cores/arduino/Print.cpp') diff --git a/cores/arduino/Print.cpp b/cores/arduino/Print.cpp index fb5afc1..6fe162d 100755 --- a/cores/arduino/Print.cpp +++ b/cores/arduino/Print.cpp @@ -19,6 +19,7 @@ Modified 23 November 2006 by David A. Mellis */ +#include #include #include #include @@ -42,6 +43,11 @@ void Print::write(const uint8_t *buffer, size_t size) write(*buffer++); } +void Print::print(const String &s) +{ + print(s.toCharArray()); +} + void Print::print(const char str[]) { write(str); @@ -99,6 +105,12 @@ void Print::println(void) print('\n'); } +void Print::println(const String &s) +{ + print(s); + println(); +} + void Print::println(const char c[]) { print(c); -- cgit v1.2.3-18-g5258