The main program launches each modules, initialises and configures them, the PIT is started
with a time out of 8000, and ADC’s end of conversion interrupt is connected to the
ADC_EOC_Interrupt handler:
Depending on an internal state variable, the value read by the ADC either affects the OPWM’s
duty cycle or some LEDs. The state selection is done in the main loop of the program using input
buttons.