Buffered, bidirectional transfer through the default Serial channel
Dependencies: mbed BufferedSerial
Revision 0:8c6fe9fb4192, committed 2021-12-16
- Comitter:
- cspista
- Date:
- Thu Dec 16 12:37:54 2021 +0000
- Commit message:
- Final version
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BufferedSerial.lib Thu Dec 16 12:37:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/cspista/code/BufferedSerial/#ea5ad8e00c99
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 16 12:37:54 2021 +0000 @@ -0,0 +1,23 @@ + +/* + * Use: BufferedSerial library + * adopted for STM32F4 series by Veysel KARADAG + * https://os.mbed.com/users/veyselka/code/BufferedSerial/ + */ +#include "mbed.h" +#include "BufferedSerial.h" + +BufferedSerial pc(USBTX, USBRX, 1024); + +int main() +{ + pc.printf("\r\nWelcome to NUCLEO-F446RE board!\r\n"); + while(1) { + if(pc.readable() > 0) { + char c = pc.getc(); //Read one character + if((c>32) && (c<128)) { + pc.printf("received char: %c = %d\r\n",c,c); + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Dec 16 12:37:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file