Controlling a Servo from the Mavic Air Controller by daniedb 3d model
3dmdb logo
Thingiverse
Controlling a Servo from the Mavic Air Controller by daniedb

Controlling a Servo from the Mavic Air Controller by daniedb

by Thingiverse
Last crawled date: 3 years ago
This project was only to see if it will work, and now I see a few possibilities for this.
HOW IT WORKS.
Actually this is very straight forward, on the inner workings of this unit.
I’m using the Mavic Air front Lights to control the Servo
In DJI go 4 App, you can assign funtions to the “C” and “Fn” buttons on the controller
STEP 1:
In the DJI Go 4 App, goto the Remote Controller settings, and assign “Turn on/off head
LED’s” to “Fn” or “C” switches.
STEP 2:
Building the Arduino Unit
What you will need.
3D Printer or ask a friend
1 x Photo Resistor
1 x 10K resistor 1/4W
1 x Arduino Pro Mini
1 x 7.2v 2S Lipo 200-500mah
Some knowledge on how to program an arduino Pro Mini using the Arduino IDE
(www.arduino.cc)

#include
int HighValue = 800; //Change this to adjust sensitivity for your sensor
int SensorPin = A0;
int ServoMin = 90;
int ServoMax = 175; // change this for servo arm movement
int ServoPin = 9;
int delayValue = 10;
Servo myservo; // create servo object to control a servo
void setup() { // Serial monitor to read value
Serial.begin(9600);
myservo.attach(ServoPin);
}
void loop() {
Serial.println(analogRead(SensorPin));
if (analogRead(SensorPin) > HighValue){
myservo.write(ServoMin);
}else{
myservo.write(ServoMax);
}
delay(delayValue);
}

Tags