summaryrefslogtreecommitdiff
path: root/project/Core/Src/Activties
diff options
context:
space:
mode:
Diffstat (limited to 'project/Core/Src/Activties')
-rw-r--r--project/Core/Src/Activties/activity5.c24
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();
+ }
+}