*
Dependencies: mbed-STM32F103C8T6 mbed
main.cpp@0:d813e98904a8, 2017-04-29 (annotated)
- Committer:
- BaserK
- Date:
- Sat Apr 29 15:29:05 2017 +0000
- Revision:
- 0:d813e98904a8
*
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
BaserK | 0:d813e98904a8 | 1 | #include "stm32f103c8t6.h" |
BaserK | 0:d813e98904a8 | 2 | #include "mbed.h" |
BaserK | 0:d813e98904a8 | 3 | |
BaserK | 0:d813e98904a8 | 4 | // Serial example |
BaserK | 0:d813e98904a8 | 5 | // Increases a number every 200 ms and prints it on the screen |
BaserK | 0:d813e98904a8 | 6 | |
BaserK | 0:d813e98904a8 | 7 | Serial com(SERIAL_TX, SERIAL_RX); |
BaserK | 0:d813e98904a8 | 8 | int data = 0; |
BaserK | 0:d813e98904a8 | 9 | |
BaserK | 0:d813e98904a8 | 10 | int main() |
BaserK | 0:d813e98904a8 | 11 | { |
BaserK | 0:d813e98904a8 | 12 | confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) |
BaserK | 0:d813e98904a8 | 13 | com.baud(9600); |
BaserK | 0:d813e98904a8 | 14 | |
BaserK | 0:d813e98904a8 | 15 | while (1) |
BaserK | 0:d813e98904a8 | 16 | { |
BaserK | 0:d813e98904a8 | 17 | com.printf("Value is: %d \r\n", data); |
BaserK | 0:d813e98904a8 | 18 | data++; |
BaserK | 0:d813e98904a8 | 19 | wait_ms(200); |
BaserK | 0:d813e98904a8 | 20 | } |
BaserK | 0:d813e98904a8 | 21 | } |