diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-09-23 15:27:41 -0400 |
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-09-23 15:27:41 -0400 |
| commit | 86130c8747a4af7ce93f4ac93d1c4d9c94c917eb (patch) | |
| tree | e289b5e59bb0143d9a744743978b2ae7360440e1 /project/Core/Src/Activties/activity5.c | |
| parent | 73a76acef4aa14b042c9c56eef0fd19164afff42 (diff) | |
| download | 340-repo-Sowgro-86130c8747a4af7ce93f4ac93d1c4d9c94c917eb.tar.gz 340-repo-Sowgro-86130c8747a4af7ce93f4ac93d1c4d9c94c917eb.tar.bz2 340-repo-Sowgro-86130c8747a4af7ce93f4ac93d1c4d9c94c917eb.zip | |
Add activity 5
Diffstat (limited to '')
| -rw-r--r-- | project/Core/Src/Activties/activity5.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/project/Core/Src/Activties/activity5.c b/project/Core/Src/Activties/activity5.c new file mode 100644 index 0000000..9201f70 --- /dev/null +++ b/project/Core/Src/Activties/activity5.c @@ -0,0 +1,24 @@ +/* + * activity5.c + * + * Created on: Sep 23, 2025 + * Author: sowgro + */ + + +#include <UART.h> +#include "printf.h" + +void read_and_print_char() { + uint8_t ch = USART_Read(USART2); + printf("%c", ch); + if (ch == '\r') { + printf("\n"); + } +} + +void run2() { + for(;;) { + read_and_print_char(); + } +} |
