Integrating MAVlink on Arduino Nano

Hey everybody,

I've been trying for over a week to compile MAVlink on my Arduino Nano board without success. I tried to compile the programm with 2 sketches, one of them is in this link http://qgroundcontrol.org/dev/mavlink_arduino_integration_tutorial. The tutorial is very outdated so I had to change a few lines of code in the FastSerial.cpp, FastSerial.h, BetterStream.cpp and Betterstream.h files.

This was done according to this discussion http://diydrones.com/forum/topics/beginning-tests-using-mavlink?id=705844%3ATopic%3A1142311&page=1#comments and this other one http://diydrones.com/forum/topics/compiling-arduimu-sketch-with-arduino-1-0-3.

1.Go to your FastSerial folder (the one you copied to the Arduino library folder.  Open file FastSerial.h in    your favorite text editor and change the line virtual void write(unit8_t c); to virtual size_t write(unit8_t c);  Save the file

2.Open FastSerial.cpp and change void FastSerial::Write(unit8_t c) to size_t FastSerial::Write(unit8_t c)  A couple of lines below in the same function change return; to return 0; and at the bottom of the function right before the bracket add return i;

3.In the same file (FastSerial.cpp) go back to the top and change #include "WProgram.h" to #include "Arduino.h"    Save the file and close. Open every *.cpp file in every folder and do the same thing (change WProgram.h to Arduino.h)

Furthermore in the BetterStream files I changed every "prog_char" to "const char". The library to update mavlink is here https://github.com/mavlink/c_library.

Like I said at the beginning I gave it a try with different sketches. You can find the other one https://github.com/alaney/arduino-mavlink. With this last program I was able to compile the sketch but the only thing that I could read in the serial monitor was garbage "ULdÈ UMdÈ (UNdÈ UUOdÈ ~UPdÈ GeUQdÈ laURdÈ", something like that. In addition I could connect to qgroundcontrol but only for 5 seconds or less.

I am using the latest Arduino IDE.

I would really appreciate if someone can help me.

Regards

Fabio

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…