pschatzmann / ArduinoMavlinkDrone

A Simple Arduino Mavlink Drone Library e.g. to implement a RC airplane which uses QGroundControl as Remote Controller.
Apache License 2.0
18 stars 3 forks source link

Data transfer #1

Open SoorajR-ai opened 9 months ago

SoorajR-ai commented 9 months ago

I want to make a flight controller with arduino. I'm using arduino mega. I use this library to connect to Qgroundcontrol via usb serial and i can see heart beat and gps position.

But if i want to send more datas like AHRS datas, how do i do it?

pschatzmann commented 9 months ago

It's a long time since I wrote this, but you should also be receiving values for throttle, pitch, yaw and roll!

Did you do the steps described in "Setting up QGroundControl" ?

SoorajR-ai commented 9 months ago

Thank you for your response! Yes, I have followed the steps described in 'Setting up QGroundControl.' I can successfully receive heartbeat and GPS position data. However, my goal is to send additional data such as AHRS datas and more. In addition to sending data from Arduino to QGroundControl, I'm interested in receiving data back from QGroundControl to Arduino. Could you please provide more guidance on how to achieve this or point me to relevant documentation? I appreciate your assistance

image

#include "SimpleMavlinkDrone.h"

SimpleMavlinkDrone drone(&Serial);

void setup() {
  Serial.begin(115200);

  drone.setValue(VOLTAGE_BATTERY, 5.0);
  drone.setValue(GPS_LATITUDE, 46.2227);
  drone.setValue(GPS_LONGITUDE, 7.3379);
  drone.setValue(GPS_ALTITUDE, 482.0);
}

void loop() {
  drone.loop();  
}