Need help with adding a new Log message

Hi all, it’s my first post here and I’m currently an undergrad working on my own custom drone project.
I’m still a newbie and I’ll appreciate any help given!
I want to Log a parameter that I’ve created but It’s not working as I wanted to.
I’ve read through the wiki page and apart from the fact that some files ( i.e. AP_logger.h) are missing due to version differences, I’ve managed to log “something” to the log file.
Basically, I want to return the value of _paremterA instead of Test within the function “get_Pwm”
but so far, I’ve only been allowed to return static parameters
If _parameterA can be logged, any other methods are alright as well.
I’ve pasted the codes that I’ve used briefly down below.
Thank you for you kind attention!

//LogStructure.h

struct PACKED log_Test {
LOG_PACKET_HEADER;
uint64_t time_us;
float a_value;
};

//Logfile.cpp

void DataFlash_Class::Log_Write_Test(void)
{
struct log_Test pkt = {
LOG_PACKET_HEADER_INIT(LOG_TEST_MSG),
time_us : AP_HAL::micros64(),
a_value : AP_Mount::get_Pwm(25)
};
WriteBlock(&pkt, sizeof(pkt));
}

//DataFlash.h
void Log_Write_Test(void);

//AP_Mount.h
class AP_Mount
{
public:
static float get_Pwm(float Test);
AP_Int16 _parameterA;

//AP_Mount.cpp

float AP_Mount::get_Pwm(float Test)
return Test;
}


wiki page : http://ardupilot.org/dev/docs/code-overview-adding-a-new-log-message.html

HI ALL, IT’S MY FIRST POST HERE AND I’M CURRENTLY AN UNDERGRAD WORKING ON MY OWN CUSTOM DRONE PROJECT.

Welcome!

I WANT TO LOG A PARAMETER THAT I’VE CREATED BUT IT’S NOT WORKING AS I WANTED TO.
I’VE READ THROUGH THE WIKI PAGE AND APART FROM THE FACT THAT SOME FILES ( I.E. AP_LOGGER.H) ARE MISSING DUE TO VERSION DIFFERENCES, I’VE MANAGED
TO LOG “SOMETHING” TO THE LOG FILE.

Probably a good idea to work on master :slight_smile:

Please push your branch up to github somewhere.

Could you paste any error messages you are getting, please?

Thank you for your comment!! and excuse me for me late reply…
I wasn’t sure what you meant by working on master, but I’ve uploaded the files I’ve edited on github.
[ https://github.com/orewayoshi/Arducopter_tiltProject ]
Parts I’ve edited are commented with //edit2019
I’ve also attached the screenshot when I try to log a non-static parameter.