abc1f0b201 | ||
---|---|---|
.. | ||
test/support | ||
LICENSE | ||
README.md | ||
doc.go | ||
leap_motion_adaptor.go | ||
leap_motion_adaptor_test.go | ||
leap_motion_driver.go | ||
leap_motion_driver_test.go | ||
parser.go |
README.md
Leap
This package provides the Gobot adaptor and driver for the Leap Motion
Getting Started
First install the Leap Motion Software
Now you can install the package with
go get github.com/hybridgroup/gobot && go install 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()
}