Periodic publishing of tune_control

Hello everyone,

I would like to create a program that plays a tone through the Pixhawk buzzer every 5 seconds. So far I have figured out how to emit a tone but I am stuck as to how to periodically call the function that publishes the tune_control data.

I have looked through the discussion board and I have seen the hrt_call_every function but that only seems to work for smaller intervals. I have also seen mention of using ScheduledWorkItem but I’m not sure how to integrate it into my code.

Could you explain a way for me to implement the periodic publishing or point me to an easy to understand example I could use? Thank you.