



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




// Do not remove the include below #include "PlutoPilot.h" #include "Estimate.h" #include "Utils.h" //The setup function is called once at PlutoX's hardware startup voidplutoInit () { //Add your hardware initialization code here } //The function is called once before plutoLoop() when you activate developer mode voidonLoopStart () { //Do your one time stuff here LED.flightStatus( DEACTIVATE ); } //The loop function is called in an endless loop voidplutoLoop () { //Add your repeated code here if (Velocity.get( Z ) > 0) /If the drone is moving upwards (Velocity in the Z axis will be positive)/ { LED.set( RED , ON ); LED.set( GREEN , OFF ); } else /If the drone is moving downwards/ { LED.set( RED , OFF ); LED.set( GREEN , ON ); }
Monitor.println("Velocity Z: ", Velocity.get( Z )); Graph.red(Velocity.get( Z ), 1); } //The function is called once after plutoLoop() when you deactivate developer mode voidonLoopFinish () { //Do your cleanup stuff here LED.flightStatus( ACTIVATE ); }