---
description: >-
  When you blow towards the drone the drone detects the Pressure difference and
  the drone automatically takes off and starts hovering, we can take control
  after it starts hovering.
---

# Blow to Take Off

```
// Do not remove the include below
#include "PlutoPilot.h"
#include  "Control.h"
#include "Sensor.h"
#include "Utils.h"
#include "User.h"

#define ABS(x) ((x) > 0 ? (x) : -(x))

int16_t initPressure;
int16_t currPressure;

//The setup function is called once at Pluto's hardware startup
void plutoInit()
{
// Add your hardware initialization code here
}



//The function is called once before plutoLoop when you activate Developer Mode
void onLoopStart()
{
  // do your one time stuff here
initPressure=Barometer.get(PRESSURE);

LED.flightStatus(DEACTIVATE);

}



// The loop function is called in an endless loop
void plutoLoop()
{
currPressure=Barometer.get(PRESSURE);
//Add your repeated code here

if(ABS(currPressure-initPressure)>4)

{LED.set(RED, ON);
Command.arm();
DesiredPosition.set(Z,100);
}
initPressure = initPressure*0.9 + currPressure*0.1;
		Monitor.println("oldPressure",initPressure);
        Monitor.println("newPressure",currPressure);
        Graph.red(currPressure);
}



//The function is called once after plutoLoop when you deactivate Developer Mode
void onLoopFinish()
{
LED.flightStatus(ACTIVATE);
// do your cleanup stuffs here

}





```

![When the Drone takes Off](https://2337796245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LiHGnU31k3UMwGKWEZa%2F-LjUO6M9TM0Kqax_Cjkm%2F-LjUZ9sMe1QU4gG8KQaj%2FScreenshot%20\(3\).png?alt=media\&token=daeda1c1-0862-46b7-a7d3-d0fcdcd79537)

![Blow and Take Off Drone](https://2337796245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LiHGnU31k3UMwGKWEZa%2F-LjUO6M9TM0Kqax_Cjkm%2F-LjUfteC8f97qc299-G8%2F20190711_113056.gif?alt=media\&token=8c6d03c1-6678-4161-8f2c-25ed29a3722e)

![When the door opens air pressure changes, so the Drone detects that and it starts hovering](https://2337796245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LiHGnU31k3UMwGKWEZa%2F-LjUi_L7VrmPyWgMJJag%2F-LjUk5ev5n22Kp5TH-oG%2F20190711_115757.gif?alt=media\&token=2d213c3a-b0a6-4e01-a1de-ed439ed56e86)

