forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
48 lines (34 loc) · 973 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
45
46
47
48
/*
Package leap provides the Gobot adaptor and driver for the Leap Motion.
Installing:
* First install the [Leap Motion Software](https://www.leapmotion.com/setup).
* Then install the package:
go get github.com/hybridgroup/gobot/platforms/leap
Example:
package main
import (
"fmt"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/leap"
)
func main() {
gbot := gobot.NewGobot()
leapMotionAdaptor := leap.NewLeapMotionAdaptor("leap", "127.0.0.1:6437")
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() {
gobot.On(l.Event("message"), func(data interface{}) {
fmt.Println(data.(leap.Frame))
})
}
robot := gobot.NewRobot("leapBot",
[]gobot.Connection{leapMotionAdaptor},
[]gobot.Device{l},
work,
)
gbot.AddRobot(robot)
gbot.Start()
}
For more information refer to the leap README:
https://github.com/hybridgroup/gobot/blob/master/platforms/leap/README.md
*/
package leap