Metehan Emlik
Published © MPL-2.0

Make an ESPcopter Altitude Indicator

In this project, we will make an altitude Indicator using NeoPixel shield.

BeginnerProtip1 hour904

Things used in this project

Hardware components

espcopter
×1
espcopter neopixel shield
×1
espcopter optical flow shield
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code

Arduino
#define REMOTEXY_WIFI_SSID "ESPcopter" //ESPcopter Wiffi name
#define REMOTEXY_WIFI_PASSWORD "12345678" //ESPcopter Wiffi pass

#define REMOTE_XY_REMOTE // control method 

#include <espcopter.h> // ESPcopter lib

void setup() {
 mainSetup(); // main settings
 setTrimRoll(0);
 setTrimPitch(0);
 setTrimYaw(0);
}
void loop() {
  mainLoop ();  // main loop

for(int i =0; i < altitudeDrone; i++){// for loop for switching the leds on
   if(i < 4){ // if altitude of drone is lower than 40cm 
   ESPsetPixel(i,0,255,0); // on green 0-4
   }
   if(i >= 4 && i < 8 ){ // if altitude of drone  is between 40cm and 80cm 
   ESPsetPixel(i,0,0,255); // on blue 4-8
   }
   if(i >= 8 && i < 12){ // if altitude of droneis between 80cm and 120cm 
   ESPsetPixel(i,255,0,0); // on red 8-12
   }
 }
 for(int i =11; altitudeDrone < i; i--){ // for loop  for switching the leds off
   ESPsetPixel(i,0,0,0);
 }
 ESPpixelShow(); // commint*/

}

Credits

Metehan Emlik

Metehan Emlik

10 projects • 9 followers

Comments