Black Vortex Megapirates 2.5.1 R2

With the release of Megapirates 2.5.1 R2 I decided to test it out on my Black Vortex. With the latest software I was also able to use the apc220 wireless telemetry module with mission planner 1.1.54 without any modifications to the megapirates software. I found the connection much more responsive than with 2.0.49 using the apc220.

 

Download Megapirates 2.5.1

Download MissionPlanner

A list of PID settings and model specifications can be viewed here.

 

‘APM_config.h’:

#define PIRATES_SENSOR_BOARD PIRATES_BLACKVORTEX

#define TX_CHANNEL_SET TX_mwi

#define CONFIG_BARO AP_BARO_BMP085_PIRATES

#define MAX_SONAR_RANGE 400

#define GPS_PROTOCOL GPS_PROTOCOL_BLACKVORTEX

#define SERIAL0_BAUD 115200
#define SERIAL2_BAUD 38400
#define SERIAL3_BAUD 57600

#define FRAME_CONFIG QUAD_FRAME

#define FRAME_ORIENTATION X_FRAME

# define CH7_OPTION CH7_DO_NOTHING

 

For enabling the relay functionality of the Black Vortex I modified the following lines of code. With these additions to the code you will be able to trigger the relay from a spare channel on your radio. If you would like to change the channel or the pwm value to detect, the only line that must be modified is “ if(g.rc_6.radio_in > 1500)”.

 

‘APM_config.h’:

#define USERHOOK_SLOWLOOP userhook_SlowLoop();

#define USERHOOK_INIT userhook_init();

#define USERHOOK_VARIABLES “UserVariables.h”

 

‘usercode’:

void userhook_init()
{
pinMode(relay_pin,OUTPUT);
digitalWrite(relay_pin,LOW);
}

void userhook_SlowLoop()
{
 if(g.rc_6.radio_in > 1500){
digitalWrite(relay_pin,HIGH);
}else{
digitalWrite(relay_pin,LOW);
}
}

‘uservariables.h’:

int relay_pin = 37;