I reverse engineer the design in most flashlight's brightness control part of the driver. I isolate the PWM and microcontroller part of the circuit and hook it up to BenBoost or other similar driver runs with PWM. The board is tiny!! And the code for Attiny13 can be find on budget light forum. I program this to be 5-mode, low-mid-high-strobe-SOS with mode memory. It fits into Aixiz with BenBoost, It's a tight fit, but it fits. the whole board is 7mm tall.
Here is a video!!
Here is a video!!