A microcontrolled 3 levels LED Driver
Switch simulates an off-on cycle, in flashlights this could be:
1- ON/Off button pressed in an on-off-on quickly
2- in a twisty body a quick back and forth to on-off-on the battery power.
For luck I always machine something related to my son the 1st time.
Para la buena suerte siempre mecanizo algo relacionado con mi hijo para buena suerte.