Chapter 4full coursePWMUse a timer to dim the LED smoothly.4.1What PWM is, and how a timer makes itTheoryfull coursePWM (pulse width modulation) switches a pin on and off very fast.4.2Dim the LED with PWMHands-onfull courseWe run the chip at 84 MHz, connect TIM2 channel 1 to the LED pin PA5, and make a 1 kHz PWM signal.