parth arya
Published © CC0

Beat The Heat

Pluto X drone change its position when it detects Heat or fire near to it.

IntermediateFull instructions provided4 hours580
Beat The Heat

Things used in this project

Hardware components

Drona Aviation Pluto X drone Kit
×1

Software apps and online services

Drona Aviation Cygnus IDE
Drona Aviation Pluto App

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long

Story

Read more

Schematics

front_sensor_signal_pin_13-page0002_sWst40B5EI.jpg

Code

Untitled file

C/C++
// Do not remove the include below
#include "PlutoPilot.h"
#include "utils.h"
#include "motor.h"
#include "user.h"
#include "peripheral.h"
int sensordata1 = 0;
int sensordata2 = 0;

//The setup function is called once at PlutoX's hardware startup
void plutoInit()
{ADC.init(Pin13);
 ADC.init(Pin14);
 Motor.init(M4);

//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
}
//The loop function is called in an endless loop
void plutoLoop()
{ADC.read(Pin13);
sensordata1=ADC.read(Pin13);
Monitor.println("pitch", sensordata1);
ADC.read(Pin14);
sensordata2=ADC.read(Pin14);
Monitor.println("roll", sensordata2);


if(sensordata1>500)
{
	RcCommand.set(RC_PITCH, RcData.get(RC_PITCH));
}
if(sensordata1<=500 && sensordata1>350)
{
RcCommand.set(RC_PITCH,1450);
	}
if(sensordata1<=350 && sensordata1>150)
{
RcCommand.set(RC_PITCH,1350);
	}
if(sensordata1<=150)
{
RcCommand.set(RC_PITCH,1250);
	}
if(sensordata2>500)
{
	RcCommand.set(RC_ROLL, RcData.get(RC_ROLL));
}
if(sensordata2<=500 && sensordata2>350)
{
RcCommand.set(RC_ROLL,1450);
	}
if(sensordata2<=350 && sensordata2>150)
{
RcCommand.set(RC_ROLL,1350);
	}
if(sensordata2<=150)
{
RcCommand.set(RC_ROLL,1250);
	}
}

//The function is called once after plutoLoop() when you deactivate developer mode

Credits

parth arya

parth arya

1 project • 1 follower

Comments