STM32 PART 7 - A STATE MACHINE (USING THE B1)