Communication between Matek H743 Wing and Arduino

Hello.
Lately I have been wanting to connect an Arduino to my Matek H743 wing and read data trough MAVLINK.
Specifically GPS and attitude
After searching I found a code which lets you do it: GitHub - shashikg/PixhawkArduinoMAVLink: Arduino Library to receive Pixhawk sensor's data.
(I downloaded this library inside Arduino IDE)

However I could not make it work.
I could not even compile the example provided

after looking at the error for sometime I moved the “PixhawkArduinoMAVLink” .h file to the SRC folder.
Then I got an error saying it could not find a different file…
Does anyone know why Arduino IDE cant find these files even tough they are there?


first have a look in your explorer if the files are actually there.

There are two ways to initialize the libraries. one with <> and one with “”. One is your local folder, one is the os wide library for arduino.
Just try both…

Hi.
I tried to look.
both in the Arduino example and in the code itself it looks to be defined well.
I’m using the exact thing in the GitHub URL I posted.

e ai amigo deu certo ???

Hi.
Yes it did.
The problem was within the function definition.
In the pixhawkarduinomavlink.cpp there are two flags in the while loop. (in the definition of the mav.Read) the operator between them is an OR.
A quick fix without touching much of the code is just to change it to an AND (&&).
After that the loop does not get stuck.
Right now I am stuck on trying to run it on an ESP8266 (going forward😆)

Kind regards
Nimrod

Ps.
@c.rieger helped a lot. That was also a problem.

e ai amido deu certo ???