Ardupilot example code does not behave as I expected


I’m very interested with Ardupilot Code. Always thank you for you expert’s answers.

I ran “AP_Notify_test.cpp” for knowing how ardupilot’s buzzer works.

before run buzzer, I tried to modify the code to print some phrases for prior test, and it didn’t work.

I added below code in the loop :

hal.console->printf("AP_Notify library test\n");

However, it didn’t work.

below is the video and full code :

 *       Example of AC_Notify library .

#include <AP_HAL/AP_HAL.h>
#include <AP_Notify/AP_Notify.h>          // Notify library
#include <AP_Notify/AP_BoardLED.h>        // Board LED library
#include <AP_Notify/Buzzer.h>             // Buzzer Library

void setup();
void loop();

const AP_HAL::HAL& hal = AP_HAL::get_HAL();

// create board led object
AP_BoardLED board_led;

//Buzzer board_buzzer;

void setup()
    hal.console->printf("AP_Notify library test\n");

    // initialise the board leds

    // turn on initialising notification
    AP_Notify::flags.initialising = true;
    AP_Notify::flags.gps_status = 1;
    AP_Notify::flags.armed = 1;
    AP_Notify::flags.pre_arm_check = 1;

void loop()
    hal.console->printf("AP_Notify library test\n");


Problem solved.

I was editing wrong file.

I confused Visual Studio Code’s copy and paste system. that was the cause of the problem.