When you fly the drone in the developer mode the drones heading will be changing with the Mobile, with the help of this you can change the yaw of the drone.
App Heading Program/Code
// Do not remove the include below
#include "PlutoPilot.h"
#include "Utils.h"
#include "Estimate.h"
#include "User.h"
#include "Control.h"
int16_t appheading=0;
//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
LED.flightStatus(DEACTIVATE);
}
// The loop function is called in an endless loop
void plutoLoop()
{
appheading=App.getAppHeading();
Monitor.print("Phone",appheading);
//Add your repeated code here
appheading+=90;
if (appheading>360)
appheading=360;
LED.set(RED,ON);
LED.set(GREEN,ON);
DesiredAngle.set(AG_YAW,appheading);
}
//The function is called once after plutoLoop when you deactivate Developer Mode
void onLoopFinish()
{
// do your cleanup stuffs here
}