mbed official
/
Serial_HelloWorld_Mbed
Serial Hello World
mbed 2 and mbed OS 5
This is an mbed 2 example. For an mbed-os example, please see:
Import programSerial_HelloWorld
Serial Hello World
main.cpp@0:879aa9d0247b, 2013-02-12 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Feb 12 17:39:05 2013 +0000
- Revision:
- 0:879aa9d0247b
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 | } |