Everything about Drone
  • Drone (Dynamic Remotely Operated Navigation Equipment)
  • About Me
  • Types of Drones
  • Applications of Drone
  • Categories of Drones in India
  • Motor Configuration and Controls for Quadcopter
  • Assembling Pluto Drone
  • Dynamics of DRONEs
    • Force and Moments
    • Orientation and position
    • Moving in z, x & y direction
  • Sensors which are used on a Drone
  • Rules & Regulations
  • Testing & Executing codes
    • Acro Mode
    • Blow to Take Off
    • App Heading
    • Monitoring the Pressure Difference
    • Throw and Go
    • Flipping
  • Laser Cutting
  • Laser Cutting Procedure
  • 3D Printing Drone case
  • Table Tennis Game
  • ROS (Robotic Operating System)
    • ROS Master
    • ROS Nodes
    • ROS Topics
    • ROS Message
    • Workspace (catkin)
    • Examples
      • Creating ROS Workspace
      • Publisher in ROS
      • Subscriber in ROS
      • Testing Publisher and Subscriber nodes
      • Add two int in ROS
      • Building Nodes
      • Pluto Node
Powered by GitBook
On this page

Was this helpful?

  1. Testing & Executing codes

Blow to Take Off

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.

// 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

}




PreviousAcro ModeNextApp Heading

Last updated 5 years ago

Was this helpful?

When the Drone takes Off
Blow and Take Off Drone
When the door opens air pressure changes, so the Drone detects that and it starts hovering