Serial Hello World
Fork of Serial_HelloWorld_Mbed by
Note
For simple debug statements over the USB UART channel you can just call printf and it will be automatically redirected to the terminal over USB.
API
API summary
Import librarymbed
main.cpp@0:879aa9d0247b, 2013-02-12 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Feb 12 17:39:05 2013 +0000
- Revision:
- 0:879aa9d0247b
- Child:
- 1:560b8ced44df
Serial HelloWorld
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:879aa9d0247b | 1 | #include "mbed.h" |
mbed_official | 0:879aa9d0247b | 2 | |
mbed_official | 0:879aa9d0247b | 3 | Serial pc(USBTX, USBRX); // tx, rx |
mbed_official | 0:879aa9d0247b | 4 | |
mbed_official | 0:879aa9d0247b | 5 | int main() { |
mbed_official | 0:879aa9d0247b | 6 | pc.printf("Hello World!\n"); |
mbed_official | 0:879aa9d0247b | 7 | while(1) { |
mbed_official | 0:879aa9d0247b | 8 | pc.putc(pc.getc() + 1); |
mbed_official | 0:879aa9d0247b | 9 | } |
mbed_official | 0:879aa9d0247b | 10 | } |