diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-09-30 15:30:46 -0400 |
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-09-30 15:30:46 -0400 |
| commit | aff39df39db30502e03297d5754857b21e1a8455 (patch) | |
| tree | fdebaac136f91ce981e78c1444cef78f2f6787b0 /project/Core/Src | |
| parent | 0062ce3d8c64ed7b0cf0c94e8dcc2cc316df4fb1 (diff) | |
| download | 340-repo-Sowgro-aff39df39db30502e03297d5754857b21e1a8455.tar.gz 340-repo-Sowgro-aff39df39db30502e03297d5754857b21e1a8455.tar.bz2 340-repo-Sowgro-aff39df39db30502e03297d5754857b21e1a8455.zip | |
activity6
Diffstat (limited to '')
| -rw-r--r-- | project/Core/Src/Activties/activity7.c | 26 | ||||
| -rw-r--r-- | project/Core/Src/main.c | 6 |
2 files changed, 30 insertions, 2 deletions
diff --git a/project/Core/Src/Activties/activity7.c b/project/Core/Src/Activties/activity7.c new file mode 100644 index 0000000..2ffc9e8 --- /dev/null +++ b/project/Core/Src/Activties/activity7.c @@ -0,0 +1,26 @@ +/* + * activity7.c + * + * Created on: Sep 30, 2025 + * Author: sowgro + */ + +#include "LED.h" +#include "UART.h" +#include <stdio.h> + +void activity7_run() { + for(;;) { + uint8_t ch = USART_Read(USART2); + printf("%c", ch); + if (ch == '\r') { + printf("\n"); + } + if (ch == '0') { + LED_On(); + } + if (ch == 'f') { + LED_Off(); + } + } +} diff --git a/project/Core/Src/main.c b/project/Core/Src/main.c index 0ea5a3f..f447b8b 100644 --- a/project/Core/Src/main.c +++ b/project/Core/Src/main.c @@ -11,6 +11,7 @@ #include "activity4.h" #include "activity5.h" #include "activity6.h" +#include "activity7.h" #include <stdio.h> int main(void){ @@ -24,9 +25,10 @@ int main(void){ // activity4_run(); // activity5_run(); - activity6_run(); +// activity6_run(); + activity7_run(); // application run function - // run_demo() ; +// run_demo() ; } |
