The idea of this recipe, which we'll call
timerISR_c5v0, is to use a general purpose timer (TIM2) to generate an interrupt every 100 ms (that is, 10 Hz). The interrupt handler maintains a counter that, in turn, sets the global variables,
LEDOff, which are used within
main () to flash the LEDs.
Follow the steps to configure general purpose timers:
timerISR_c5v0. Invoke uVision5 and create a new project named
timerISR.c, and enter the following statements. Remember to include the boilerplate: ...