Anton Boyt / lib_LCD_oem

Fork of lib_LCD_oem by Y SI

Revision:
1:3017fba9d65a
diff -r 1323ab32b8ca -r 3017fba9d65a printf.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/printf.h	Fri Nov 21 14:51:10 2014 +0000
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
+ 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+ */
+ 
+/**
+ * @file printf.h
+ *
+ * Setup necessary to direct stdout to the Arduino Serial library, which
+ * enables 'printf'
+ */
+
+#ifndef __PRINTF_H__
+#define __PRINTF_H__
+
+int serial_putc( char c, FILE * ) 
+{
+  Serial.write( c );
+
+  return c;
+} 
+
+void printf_begin(void)
+{
+  fdevopen( &serial_putc, 0 );
+}
+
+#endif // __PRINTF_H__
+