Wled strobe

Hi, I’m trying to make a diy Novatrope [How Does It Work | NovaTropes] and I would like to control the LEDs with Wled, but in order for the illusion to work, the lights need to strobe on and off at around 40 Hz. I am going to connect the motor to the relay pin that Wled uses so it will start spinning when the lights turn on. I was thinking of adding a rotary encoder to tune the frequency of the LEDs, and I was wondering how I could add that to the code, and If I could possibly change the frequency in the web interface.

Thanks for the help