hybridgroup.gobot/platforms/parrot/ardrone/doc.go

45 lines
920 B
Go
Raw Normal View History

2014-10-16 05:43:38 +08:00
/*
2014-10-29 05:52:59 +08:00
Package ardrone provides the Gobot adaptor and driver for the Parrot Ardrone.
2014-10-16 05:43:38 +08:00
Installing:
go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/parrot/ardrone
2014-10-16 05:43:38 +08:00
Example:
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/parrot/ardrone"
2014-10-16 05:43:38 +08:00
)
func main() {
ardroneAdaptor := ardrone.NewAdaptor()
drone := ardrone.NewDriver(ardroneAdaptor)
2014-10-16 05:43:38 +08:00
work := func() {
drone.TakeOff()
2016-10-17 14:43:04 +08:00
drone.On(drone.Event("flying"), func(data interface{}) {
2014-10-16 05:43:38 +08:00
gobot.After(3*time.Second, func() {
drone.Land()
})
})
}
robot := gobot.NewRobot("drone",
[]gobot.Connection{ardroneAdaptor},
[]gobot.Device{drone},
work,
)
robot.Start()
2014-10-16 05:43:38 +08:00
}
For more information refer to the ardrone README:
https://github.com/hybridgroup/gobot/tree/master/platforms/parrot/ardrone/README.md
2014-10-16 05:43:38 +08:00
*/
package ardrone // import "gobot.io/x/gobot/platforms/parrot/ardrone"