Skip to content

Instantly share code, notes, and snippets.

@toricls
Created April 27, 2018 07:54
Show Gist options
  • Save toricls/aa62f4bf83c039f494279b8122ec740f to your computer and use it in GitHub Desktop.
Save toricls/aa62f4bf83c039f494279b8122ec740f to your computer and use it in GitHub Desktop.
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/dji/tello"
)
func main() {
drone := tello.NewDriver("8888")
work := func() {
gobot.After(5*time.Second, func() {
drone.TakeOff()
})
gobot.After(10*time.Second, func() {
drone.FrontFlip()
})
gobot.After(15*time.Second, func() {
drone.BackFlip()
})
gobot.After(20*time.Second, func() {
drone.Land()
})
}
robot := gobot.NewRobot("tello",
[]gobot.Connection{},
[]gobot.Device{drone},
work,
)
robot.Start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment