alexis descamps
/
Nucleo_printf
test printf
main.cpp@1:e9d1c42a73ae, 2014-02-28 (annotated)
- Committer:
- bcostm
- Date:
- Fri Feb 28 06:52:34 2014 +0000
- Revision:
- 1:e9d1c42a73ae
- Parent:
- 0:028fac66239d
Add note for hyperterminal configuration.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 0:028fac66239d | 1 | #include "mbed.h" |
bcostm | 1:e9d1c42a73ae | 2 | |
bcostm | 1:e9d1c42a73ae | 3 | //------------------------------------ |
bcostm | 1:e9d1c42a73ae | 4 | // Hyperterminal configuration |
bcostm | 1:e9d1c42a73ae | 5 | // 9600 bauds, 8-bit data, no parity |
bcostm | 1:e9d1c42a73ae | 6 | //------------------------------------ |
bcostm | 1:e9d1c42a73ae | 7 | |
bcostm | 0:028fac66239d | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
bcostm | 0:028fac66239d | 9 | |
bcostm | 0:028fac66239d | 10 | DigitalOut myled(LED1); |
bcostm | 0:028fac66239d | 11 | |
bcostm | 0:028fac66239d | 12 | int main() { |
bcostm | 0:028fac66239d | 13 | int i = 1; |
bcostm | 0:028fac66239d | 14 | pc.printf("Hello World !\n"); |
bcostm | 0:028fac66239d | 15 | while(1) { |
bcostm | 0:028fac66239d | 16 | wait(1); |
bcostm | 0:028fac66239d | 17 | pc.printf("This program runs since %d seconds.\n", i++); |
bcostm | 0:028fac66239d | 18 | myled = !myled; |
bcostm | 0:028fac66239d | 19 | } |
bcostm | 0:028fac66239d | 20 | } |
bcostm | 0:028fac66239d | 21 |