]>
git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/tests/mbed/freopen/main.cpp
5 printf("printf to stdout\n");
7 // printf to specific peripherals
8 Serial
pc(USBTX
, USBRX
);
9 pc
.printf("Serial(USBTX, USBRX).printf\n");
11 TextLCD
lcd(p14
, p15
, p16
, p17
, p18
, p19
, p20
, "lcd"); // rs, rw, e, d0-d3, name
12 lcd
.printf("TextLCD.printf\n");
14 // change stdout to file
15 LocalFileSystem
local("local");
16 freopen("/local/output.txt", "w", stdout
);
17 printf("printf redirected to LocalFileSystem\n");
20 // change stdout to LCD
21 freopen("/lcd", "w", stdout
);
22 printf("printf redirected to TextLCD\n");