Arkadi Rafalovich
/
Nucleo_printf
stm32workshop demo
main.cpp@0:3d4c65473e9d, 2017-11-09 (annotated)
- Committer:
- STM32Workshop
- Date:
- Thu Nov 09 09:16:41 2017 +0000
- Revision:
- 0:3d4c65473e9d
temp commit prinf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
STM32Workshop | 0:3d4c65473e9d | 1 | #include "mbed.h" |
STM32Workshop | 0:3d4c65473e9d | 2 | |
STM32Workshop | 0:3d4c65473e9d | 3 | //------------------------------------ |
STM32Workshop | 0:3d4c65473e9d | 4 | // Hyperterminal configuration |
STM32Workshop | 0:3d4c65473e9d | 5 | // 9600 bauds, 8-bit data, no parity |
STM32Workshop | 0:3d4c65473e9d | 6 | //------------------------------------ |
STM32Workshop | 0:3d4c65473e9d | 7 | |
STM32Workshop | 0:3d4c65473e9d | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
STM32Workshop | 0:3d4c65473e9d | 9 | |
STM32Workshop | 0:3d4c65473e9d | 10 | DigitalOut myled(LED1); |
STM32Workshop | 0:3d4c65473e9d | 11 | |
STM32Workshop | 0:3d4c65473e9d | 12 | int main() |
STM32Workshop | 0:3d4c65473e9d | 13 | { |
STM32Workshop | 0:3d4c65473e9d | 14 | pc.baud(57600); |
STM32Workshop | 0:3d4c65473e9d | 15 | int i = 1; |
STM32Workshop | 0:3d4c65473e9d | 16 | pc.printf("Hello World !\r\n"); |
STM32Workshop | 0:3d4c65473e9d | 17 | while(1) { |
STM32Workshop | 0:3d4c65473e9d | 18 | wait(1); |
STM32Workshop | 0:3d4c65473e9d | 19 | pc.printf("This program runs since %d seconds.\r\n", i++); |
STM32Workshop | 0:3d4c65473e9d | 20 | myled = !myled; |
STM32Workshop | 0:3d4c65473e9d | 21 | } |
STM32Workshop | 0:3d4c65473e9d | 22 | } |