diff options
Diffstat (limited to 'mavlink/share/pyshared/pymavlink/APM_Mavtest')
-rw-r--r-- | mavlink/share/pyshared/pymavlink/APM_Mavtest/APM_Mavtest.pde | 55 | ||||
-rw-r--r-- | mavlink/share/pyshared/pymavlink/APM_Mavtest/Makefile | 10 |
2 files changed, 65 insertions, 0 deletions
diff --git a/mavlink/share/pyshared/pymavlink/APM_Mavtest/APM_Mavtest.pde b/mavlink/share/pyshared/pymavlink/APM_Mavtest/APM_Mavtest.pde new file mode 100644 index 000000000..b903b5c16 --- /dev/null +++ b/mavlink/share/pyshared/pymavlink/APM_Mavtest/APM_Mavtest.pde @@ -0,0 +1,55 @@ +/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- + +/* + send all possible mavlink messages + Andrew Tridgell July 2011 +*/ + +// AVR runtime +#include <avr/io.h> +#include <avr/eeprom.h> +#include <avr/pgmspace.h> +#include <math.h> + +// Libraries +#include <FastSerial.h> +#include <AP_Common.h> +#include <GCS_MAVLink.h> +#include "mavtest.h" + +FastSerialPort0(Serial); // FTDI/console +FastSerialPort1(Serial1); // GPS port +FastSerialPort3(Serial3); // Telemetry port + +#define SERIAL0_BAUD 115200 +#define SERIAL3_BAUD 115200 + +void setup() { + Serial.begin(SERIAL0_BAUD, 128, 128); + Serial3.begin(SERIAL3_BAUD, 128, 128); + mavlink_comm_0_port = &Serial; + mavlink_comm_1_port = &Serial3; +} + + + +void loop() +{ + Serial.println("Starting MAVLink test generator\n"); + while (1) { + mavlink_msg_heartbeat_send( + MAVLINK_COMM_0, + mavlink_system.type, + MAV_AUTOPILOT_ARDUPILOTMEGA); + + mavlink_msg_heartbeat_send( + MAVLINK_COMM_1, + mavlink_system.type, + MAV_AUTOPILOT_ARDUPILOTMEGA); + + mavtest_generate_outputs(MAVLINK_COMM_0); + mavtest_generate_outputs(MAVLINK_COMM_1); + delay(500); + } +} + diff --git a/mavlink/share/pyshared/pymavlink/APM_Mavtest/Makefile b/mavlink/share/pyshared/pymavlink/APM_Mavtest/Makefile new file mode 100644 index 000000000..7ca38b1a2 --- /dev/null +++ b/mavlink/share/pyshared/pymavlink/APM_Mavtest/Makefile @@ -0,0 +1,10 @@ +# +# Trivial makefile for building APM +# + +# +# Select 'mega' for the original APM, or 'mega2560' for the V2 APM. +# +BOARD = mega2560 + +include ../libraries/AP_Common/Arduino.mk |