diff --git a/Group21_Lab06_Task1/main.c b/Group21_Lab06_Task1/main.c index 1a11395..d899106 100644 --- a/Group21_Lab06_Task1/main.c +++ b/Group21_Lab06_Task1/main.c @@ -27,3 +27,8 @@ void GPIO_PORT_F_init(void) #define CLOCK_HZ 16000000 // Clock frequency of EK-TM4C123GXL #define INTEN (1 << 1) // Bit 1 of CSR to enable interrupt #define SYSTICK_RELOAD_VALUE(us) ((CLOCK_HZ / 1000000) * (us) - 1) // SysTick reload value in microseconds based on clock frequency + +volatile int duty = 50; // Initial duty cycle +const volatile int PWM_PERIOD = 1000000; // Period for 100kHz in microseconds (10ms) +volatile int ontime = 0; // Variable to track on time +//volatile bool ledState = false; // State of the LED