Hi everyone,

I've been trying to arm my pixhawk using an arduino uno, I took the example code from

https://groups.google.com/forum/#!topic/qgroundcontrol/K_8FIQVGqaU 

to send a heart beat packet.

I also have been reading this post  - http://diydrones.com/forum/topics/overriding-remote-control-from-a-custom-gs-with-mavlink

From what I gathered I need to use the COMMAND_LONG message to arm my pixhawk. 

so I wrote this code..The idea behind the code is than when I press the capacitive sensor  it will arm then when i don't it will dis arm..... but when I did it it did not work.

please see attached for the .ino code

Would it be possible if anyone could help me on this please?? :))))))

ArduinoMAVLink.ino

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

Join diydrones

Email me when people reply –

Replies

  • Recent (sort of) Arduino IDE updates changed the way you can reference libraries in subdirectories. This SO post should hopefully help you figure it out: https://stackoverflow.com/a/43819733/1940286

    Jamie Tank said:

    I have done this and yet it still comes up with an error now saying 

    "fatal error: c_library_v2/common/mavlink.h: No such file or directory"

    I am confused to why it still isn't compiling when the path on the code and the library is correct.

  • That I dont know how to solve. lol.

    I am using visual studio 2017 with visual micro plugin 

    VS - https://www.visualstudio.com/downloads/

    visual micro - http://www.visualmicro.com/

    once you can compile a arduino project i.e. a blink code on this then enable "deep search" under vMicro tab>> compiler>>deep search

    That works for me. let me know how it goes.

    Jamie Tank said:

    I have done this and yet it still comes up with an error now saying 

    "fatal error: c_library_v2/common/mavlink.h: No such file or directory"

    I am confused to why it still isn't compiling when the path on the code and the library is correct.



    czar balangue said:

    I use this library now - https://github.com/mavlink/c_library_v2

    clone this to your library folder on i.e. "Documents/Arduino/libraries"

    and I include it like this on my sketch

    #include <c_library_v2/common/mavlink.h>



    Jamie Tank said:

    hi there, 

    I realise this is 3 years late but I was using your code to work on the same project as yours. To interface pixhawk and arduino uno and programme it to arm/disarm and to make it autonomous at one point.

    I put your code into arduino IDE and am getting the following error.

    "fatal error: AP_HAL/AP_HAL.h: No such file or directory"

    Even though i have this AP_HAL in my library folder.

    I was hoping you or anyone would be able to walk me through this.

    Thanks

  • I have done this and yet it still comes up with an error now saying 

    "fatal error: c_library_v2/common/mavlink.h: No such file or directory"

    I am confused to why it still isn't compiling when the path on the code and the library is correct.



    czar balangue said:

    I use this library now - https://github.com/mavlink/c_library_v2

    clone this to your library folder on i.e. "Documents/Arduino/libraries"

    and I include it like this on my sketch

    #include <c_library_v2/common/mavlink.h>



    Jamie Tank said:

    hi there, 

    I realise this is 3 years late but I was using your code to work on the same project as yours. To interface pixhawk and arduino uno and programme it to arm/disarm and to make it autonomous at one point.

    I put your code into arduino IDE and am getting the following error.

    "fatal error: AP_HAL/AP_HAL.h: No such file or directory"

    Even though i have this AP_HAL in my library folder.

    I was hoping you or anyone would be able to walk me through this.

    Thanks

    ARMING/DISARMING pixhawk using arduino uno via MAVLINK COMMS protocol
    Hi everyone, I've been trying to arm my pixhawk using an arduino uno, I took the example code from https://groups.google.com/forum/#!topic/qgroundc…
  • I use this library now - https://github.com/mavlink/c_library_v2

    clone this to your library folder on i.e. "Documents/Arduino/libraries"

    and I include it like this on my sketch

    #include <c_library_v2/common/mavlink.h>



    Jamie Tank said:

    hi there, 

    I realise this is 3 years late but I was using your code to work on the same project as yours. To interface pixhawk and arduino uno and programme it to arm/disarm and to make it autonomous at one point.

    I put your code into arduino IDE and am getting the following error.

    "fatal error: AP_HAL/AP_HAL.h: No such file or directory"

    Even though i have this AP_HAL in my library folder.

    I was hoping you or anyone would be able to walk me through this.

    Thanks

    mavlink/c_library_v2
    Official reference C / C++ library for the v2 protocol - mavlink/c_library_v2
  • hi there, 

    I realise this is 3 years late but I was using your code to work on the same project as yours. To interface pixhawk and arduino uno and programme it to arm/disarm and to make it autonomous at one point.

    I put your code into arduino IDE and am getting the following error.

    "fatal error: AP_HAL/AP_HAL.h: No such file or directory"

    Even though i have this AP_HAL in my library folder.

    I was hoping you or anyone would be able to walk me through this.

    Thanks

  • Hi, I just figured it out after a couple of hours lol.

    please find attached for the arduino code. 

    ArduinoMAVLink.ino

This reply was deleted.

Activity