From cff905096851398315b22dca341e89ab657f12d8 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 18 Nov 2025 15:10:55 -0500 Subject: complete activity 13 --- project/Core/Src/Activties/activity13.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 project/Core/Src/Activties/activity13.c (limited to 'project/Core/Src/Activties') diff --git a/project/Core/Src/Activties/activity13.c b/project/Core/Src/Activties/activity13.c new file mode 100644 index 0000000..19eb0a4 --- /dev/null +++ b/project/Core/Src/Activties/activity13.c @@ -0,0 +1,26 @@ +/* + * activity13.c + * + * Created on: Nov 18, 2025 + * Author: sowgro + */ +#include +#include +#include "systick.h" + +//write 1s for half the freq and 0s for the other half +void play_freq(uint8_t hz) { + uint32_t rollover =herz_to_systicks(hz); + int count = systick_get_count(); + if ((count % rollover) < (rollover >> 1)) + printf("1"); + else + printf("0"); +} + +void activity13_run() { + init_systick(); + for(;;) { + play_freq(1); + } +} -- cgit v1.2.3