1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-01 13:48:57 +08:00

45 lines
897 B
Go
Raw Normal View History

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