István Cserny
/
Lab05_serial_test
main.cpp@0:dae7360f58d4, 2021-12-16 (annotated)
- Committer:
- cspista
- Date:
- Thu Dec 16 12:34:37 2021 +0000
- Revision:
- 0:dae7360f58d4
Final version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cspista | 0:dae7360f58d4 | 1 | #include "mbed.h" |
cspista | 0:dae7360f58d4 | 2 | |
cspista | 0:dae7360f58d4 | 3 | Serial pc(USBTX,USBRX); //UART via ST-Link |
cspista | 0:dae7360f58d4 | 4 | |
cspista | 0:dae7360f58d4 | 5 | int main() |
cspista | 0:dae7360f58d4 | 6 | { |
cspista | 0:dae7360f58d4 | 7 | pc.printf("\r\nWelcome to NUCLEO-F446RE board!\r\n"); |
cspista | 0:dae7360f58d4 | 8 | while(1) { |
cspista | 0:dae7360f58d4 | 9 | char c = pc.getc(); //Read one character |
cspista | 0:dae7360f58d4 | 10 | pc.printf("received char: %c = %d\r\n",c,c); |
cspista | 0:dae7360f58d4 | 11 | } |
cspista | 0:dae7360f58d4 | 12 | } |