Hi Ruhaizah,
I am sorry for the late reply. Just in case you haven’t solved your problem. This might help you.
1st step: download the mavlink library version 2
https://github.com/mavlink/c_library_v2
2nd step: you do not need all folders that you downloaded. Copy the “common” folder inside your “c_library_v2” folder and paste to your arduino library
3rd step: copy “protocol.h” inside your “c_library_v2” folder and paste to the “common” folder (your “common” folder should be in arduino library now )
4th step: edit the “mavlink.h” file inside your “common” folder and add this line include "protocol.h". Then save and close.
5th step: In your arduino ide, type include "mavlink.h". You now can use the mavlink library to communicate between pixhawk and arduino.
P/S: Look through this to understand the messages definition. https://mavlink.io/en/messages/common.html
I didnt really go through again the steps. So the steps might not work. In case it does not work, please let me know.