#!/bin/sh
#
# @name H4 680mm with Z1 Tiny2 Gimbal
#
# @type Quadrotor x
# @class Copter
#
# @maintainer Leon Mueller <thedevleon>
#

sh /etc/init.d/rc.mc_defaults

set MIXER quad_x
set PWM_OUT 1234

set MIXER_AUX mount
set PWM_AUX_OUT 123456

# The Z1 Tiny2 can handle up to 400Hz
# and works with min 1020us, middle 1520us, max 2020us
# see http://www.zhiyun-tech.com/uploadfile/datedown/instruction/Tiny2_English_instructionV1.03.pdf
# under Gimbal Connection Instruction

if [ $AUTOCNF = yes ]
then
	param set PWM_AUX_DISARMED 1520
	param set PWM_AUX_MIN 1020
	param set PWM_AUX_MAX 2020
	param set PWM_AUX_RATE 400
fi

# Start FrSky telemetry on SERIAL4 (ttyS6, designated "SERIAL4/5" on the case)
frsky_telemetry start -d /dev/ttyS6
