0% found this document useful (0 votes)
6 views2 pages

Mavic Mini Starter Arduino NANO

This document contains code for a battery hack for the DJI Mavic Mini, created by Zolly in June 2021. It includes setup and loop functions to control a MOSFET and LED based on button input and data checks. Users are encouraged to modify and share the code while retaining the credit information provided.

Uploaded by

ryandwisaputra07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Mavic Mini Starter Arduino NANO

This document contains code for a battery hack for the DJI Mavic Mini, created by Zolly in June 2021. It includes setup and loop functions to control a MOSFET and LED based on button input and data checks. Users are encouraged to modify and share the code while retaining the credit information provided.

Uploaded by

ryandwisaputra07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/*

This is a code for a DJI Mavic Mini battery hack.


Created by Zolly. 2021-june-16
The link to the video explaining this code is:
https://youtu.be/EMUqGaAxafA
FEEL FREE TO USE, CHANGE, DISTRIBUTE THIS ANY WAY YOU WANT, HOWEVER LEAVE THIS
CREDIT INFORMATION IN IT!
FEEL FREE TO ORIGINATE ANY IMPROVEMENT OF THIS CODE IN THE COMMENTS SECTION OF
ABOVE VIDEO!
*/

#define LED 13
#define MOSFET 9
#define BUTTON 2
#define DATACHECK 10
unsigned long present = 0;
unsigned long finish = 0;
byte counter = 0;
int r = 0;
void setup()
{
pinMode(MOSFET, OUTPUT);
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT_PULLUP);
pinMode(DATACHECK, INPUT);
pinMode(8, INPUT);
digitalWrite(MOSFET, LOW);
digitalWrite(LED, LOW);
while (digitalRead(BUTTON) > 0) {}
digitalWrite(MOSFET, HIGH);
while (digitalRead(DATACHECK) > 0)
{
}
delay(9000);
}

void loop()
{
beginning:
present = millis();
finish = present + 42000;
while (finish > millis())
{
digitalWrite(MOSFET, HIGH);
delayMicroseconds(250);
while (digitalRead(DATACHECK) > 0)
{
}
digitalWrite(LED, HIGH);
for (int f = 0; f < 220; f++)
{
delayMicroseconds(100);
}
digitalWrite(MOSFET, LOW);
digitalWrite(LED, LOW);

for (int f = 0; f < 700; f++)


{
delay(1);
}

digitalWrite(MOSFET, HIGH);
present = millis();
finish = present + 10000;
while (finish > millis() && counter < 6)
{
delay(1);
if (digitalRead(11) > 0)
{
r++;
}
else
{
r = 0;
}
if (r > 499)
{
counter++;
digitalWrite(LED, !digitalRead(LED));
r = 0;
}
}

if (counter > 5)digitalWrite(LED, HIGH);


if (counter < 6)
{
counter = 0;
digitalWrite(LED, LOW);
goto beginning;
}

while (1)
{
present = millis();
finish = present + 30000;
while (finish > millis())
{
digitalWrite(MOSFET, HIGH);
while (digitalRead(DATACHECK) > 0) {};
for (int f = 0; f < 300; f++)
{
delayMicroseconds(100);
}
digitalWrite(MOSFET, LOW);
delay(1000);
}
digitalWrite(MOSFET, HIGH);
delay(3000);
}
}

You might also like