Results of the voltage on PIN 7 from the oscilloscope (pressing the default blue push button on Nucleo Board will change the duty cycle):


It simulates the use of a potentiometer on analog pin, whose output can be mapped in a variable that change the duty cycle via the CCR register of the timer.
Without the oscilloscope, you can use a LED to observe the dimming effect in action.