Created
August 31, 2018 20:04
-
-
Save dpurrington/190c6a9fc7a7bf342219c7577cc67605 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <CoDrone.h> | |
void setup() | |
{ | |
CoDrone.begin(115200); | |
CoDrone.AutoConnect(NearbyDrone); | |
} | |
void loop() { | |
byte bt1 = digitalRead(11); | |
byte bt2 = digitalRead(21); | |
byte bt4 = digitalRead(14); | |
byte bt5 = digitalRead(17); | |
byte bt6 = digitalRead(19); | |
byte bt3 = digitalRead(12); | |
if (bt1) | |
{ | |
for(int i = 0; i<11; i++) | |
{ | |
CoDrone.FlightEvent(TakeOff); | |
delay(2000); | |
CoDrone.FlightEvent(Landing); | |
delay(2000); | |
} | |
} | |
if (!bt6) | |
{ | |
CoDrone.Buzz(294,2); | |
//delay(1100); | |
CoDrone.Buzz(0,1); | |
} | |
if (bt3) | |
{ | |
CoDrone.Buzz(349,2); | |
//delay(1100); | |
CoDrone.Buzz(0,1); | |
} | |
if (bt4) | |
{ | |
CoDrone.Buzz(440,2); | |
//delay(1100); | |
CoDrone.Buzz(0,1); | |
} | |
if (bt5) | |
{ | |
CoDrone.Buzz(494,2); | |
//delay(1100); | |
CoDrone.Buzz(0,1); | |
} | |
if (!bt2) | |
{ | |
CoDrone.Buzz(587,2); | |
//delay(1100); | |
CoDrone.Buzz(0,1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment