RF24Audio  v1.0
Arduino Audio Streaming Realtime with NRF24L01 radios
 All Classes Files Functions Pages
printf.h
1 /*
2  Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License
6  version 2 as published by the Free Software Foundation.
7  */
8 
16 #ifndef __PRINTF_H__
17 #define __PRINTF_H__
18 
19 #ifdef ARDUINO
20 
21 int serial_putc( char c, FILE * )
22 {
23  Serial.write( c );
24 
25  return c;
26 }
27 
28 void printf_begin(void)
29 {
30  fdevopen( &serial_putc, 0 );
31 }
32 
33 #else
34 #error This example is only for use on Arduino.
35 #endif // ARDUINO
36 
37 #endif // __PRINTF_H__