forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
44 lines (33 loc) · 920 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Package ardrone provides the Gobot adaptor and driver for the Parrot Ardrone.
Installing:
go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/parrot/ardrone
Example:
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/parrot/ardrone"
)
func main() {
ardroneAdaptor := ardrone.NewAdaptor()
drone := ardrone.NewDriver(ardroneAdaptor)
work := func() {
drone.TakeOff()
drone.On(drone.Event("flying"), func(data interface{}) {
gobot.After(3*time.Second, func() {
drone.Land()
})
})
}
robot := gobot.NewRobot("drone",
[]gobot.Connection{ardroneAdaptor},
[]gobot.Device{drone},
work,
)
robot.Start()
}
For more information refer to the ardrone README:
https://github.com/hybridgroup/gobot/tree/master/platforms/parrot/ardrone/README.md
*/
package ardrone // import "gobot.io/x/gobot/platforms/parrot/ardrone"