
Controlling a Servo from the Mavic Air Controller
thingiverse
This project was only to test its functionality, and now I see a few potential applications for this. HOW IT WORKS. The inner workings of this unit are surprisingly straightforward. I'm using the Mavic Air front Lights to control the Servo via the DJI Go 4 App. In the DJI Go 4 App, you can assign functions to the "C" and "Fn" buttons on the controller as follows: STEP 1: In the Remote Controller settings, assign "Turn on/off head LED's" to either the "Fn" or "C" switches. STEP 2: Building the Arduino Unit To get started, you'll need a few components. Here's what you'll require: A 3D printer or a friend who can provide access to one 1 x Photo Resistor 1 x 10K resistor (1/4W) 1 x Arduino Pro Mini 1 x 7.2v 2S Lipo battery (200-500mah) Some knowledge on how to program an Arduino Pro Mini using the Arduino IDE Here's the code you'll need to write: #include <Servo.h> int HighValue = 800; // Adjust this value to suit your sensor's sensitivity int SensorPin = A0; int ServoMin = 90; int ServoMax = 175; // Change this value for servo arm movement int ServoPin = 9; int delayValue = 10; Servo myservo; // Create a servo object to control the servo void setup() { 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); }
With this file you will be able to print Controlling a Servo from the Mavic Air Controller with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Controlling a Servo from the Mavic Air Controller.