Need help with dimming with blynk

Hi again,
i have similar project, but its not ready for now and i write code for esp32 and esp8266.
So i can copy part of the code here for example, but i dont know how the code will work on arduino mega.
For my project i use the Ticker library created by sstaub, and I managed to control the thyristor.