Last active
August 29, 2015 14:15
-
-
Save miaoski/faa05941ae496504ef41 to your computer and use it in GitHub Desktop.
Drone lib test
This file contains hidden or 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
Drone = require './drone' | |
white = \44c2ecadf8b443d08ba485612189bb6e | |
blue = \37103d1e4f024913a2777f3f015037eb | |
red = \1447dcb43e48451b8bbd1647fa28554a | |
up = !-> it.up {steps: 30} | |
forward = !-> it.forward {steps: 300} | |
turnLeft = !-> it.turnLeft {steps: 300} | |
tiltLeft = !-> it.tiltLeft {steps: 30, speed: 100} | |
tiltRight = !-> it.tiltRight {steps: 30, speed: 100} | |
frontFlip = !-> it.frontFlip! | |
land = !-> it.land! | |
w = new Drone(white) | |
w.connect! !-> | |
w.setup! !-> | |
w.startPing! | |
w.flatTrim! | |
w.takeOff! | |
<-! setTimeout _, 2000ms; up w | |
<-! setTimeout _, 3000ms; forward w | |
<-! setTimeout _, 5000ms; turnLeft w | |
<-! setTimeout _, 3000ms; forward w | |
<-! setTimeout _, 5000ms; tiltLeft w | |
<-! setTimeout _, 2000ms; tiltRight w | |
<-! setTimeout _, 2000ms; frontFlip w | |
<-! setTimeout _, 2000ms; land w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment