How to activate buzzer in custom flight mode?

I am currently using Mission Planner with a Pixhawk. As I am new to ardupilot, i just made my first flight mode. It doesn’t do anything, but after adding the appropriate parameters to Mission Planner, It is showing up! However, anything I added to the parameters shows up regardless if code exists for the flight mode. My idea was to have the buzzer beep once it entered the custom flight mode so i know the build on the Pixhawk of the custom flight mode is getting called properly. I can’t seem to find how to interface with the buzzer and make it beep through the new mode code. I’ve looked through AP_Notify but I only have a year’s worth of experience with c++. Any help would be greatly appreciated!

Add a state variable here:

Frob that on in your init method (AP_Notify::flags.daniels_mode = 1;) and
off in Copter::exit_mode

Add a block in here to play a tone:

Add your tone here:

… and then do all the things I’ve forgotten about :wink:

3 Likes

Thank you so much! My flight mode activates perfectly. I appreciate your help.