https://github.com/okalachev/mavlink-arduino
MAVLink v2 for Arduino
https://github.com/okalachev/mavlink-arduino
arduino arduino-library mavlink uav
Last synced: 9 months ago
JSON representation
MAVLink v2 for Arduino
- Host: GitHub
- URL: https://github.com/okalachev/mavlink-arduino
- Owner: okalachev
- License: mit
- Created: 2024-01-02T16:33:30.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T00:32:25.000Z (9 months ago)
- Last Synced: 2025-04-01T01:29:51.495Z (9 months ago)
- Topics: arduino, arduino-library, mavlink, uav
- Language: C
- Homepage: https://docs.arduino.cc/libraries/mavlink/
- Size: 1.65 MB
- Stars: 28
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MAVLink v2 library for Arduino
MAVLink is a lightweight communication protocol for communication between drones (and/or ground systems) and their components.
The underlying MAVLink protocol library automatically gets updated once a month. Correspondence between the library release and MAVLink release can be seen in the [`versions.yaml`](versions.yaml) file.
Official MAVLink documentation: https://mavlink.io/en/.
## Installation
### Arduino IDE
Search for "MAVLink" in the Arduino IDE [library manager](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library) and install the library.
### arduino-cli
```bash
arduino-cli lib update-index
arduino-cli lib install MAVLink
```
## Usage
```cpp
#include
void setup() {
Serial.begin(57600);
}
void loop() {
// Send HEARTBEAT message to Serial once a second
mavlink_message_t msg;
uint8_t buf[MAVLINK_MAX_PACKET_LEN];
mavlink_msg_heartbeat_pack(1, MAV_COMP_ID_AUTOPILOT1, &msg, MAV_TYPE_QUADROTOR, MAV_AUTOPILOT_GENERIC, MAV_MODE_FLAG_MANUAL_INPUT_ENABLED, 0, MAV_STATE_STANDBY);
uint16_t len = mavlink_msg_to_send_buffer(buf, &msg);
Serial.write(buf, len);
delay(1000);
}
```
The default used [MAVLink dialect](https://mavlink.io/en/messages/#dialects) is `common`. You can use another standard MAVLink dialect like this:
```cpp
#include
```
```cpp
#include
```
See examples in the [`examples`](examples) directory.
## Copyright
Copyright for the Arduino library © Oleg Kalachev, 2024. License: [MIT](LICENSE.txt).