Figure 5—The microcontroller executes this algorithm repeatedly in an endless loop.