Anton Boyt / lib_LCD_oem

Fork of lib_LCD_oem by Y SI

Files at this revision

API Documentation at this revision

Comitter:
margadon
Date:
Fri Nov 21 14:51:10 2014 +0000
Parent:
0:1323ab32b8ca
Commit message:
lcd1

Changed in this revision

printf.h Show annotated file Show diff for this revision Revisions of this file
--- /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__
+