/* * activity9.c * * Created on: Oct 23, 2025 * Author: sowgro */ #include "GPIO.h" #include #include "stm32l4xx.h" #include "LED.h" #include // write a function that prints on/off when the blue button is pressed void activity9_run() { GPIO_Init(); int prev_status = -1; for (;;) { int status = !(B1_GPIO_Port->IDR & B1_Pin); if (status != prev_status) { prev_status = status; if (status) { printf("on\r\n"); LED_On(); } else { printf("off\r\n"); LED_Off(); } } } }