hybridgroup.gobot/platforms/leap/doc.go

46 lines
965 B
Go
Raw Normal View History

/*
2014-10-29 05:52:59 +08:00
Package leap provides the Gobot adaptor and driver for the Leap Motion.
Installing:
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
Install the [Leap Motion Software](https://www.leapmotion.com/setup).
Example:
package main
import (
"fmt"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/platforms/leap"
)
func main() {
leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437")
l := leap.NewDriver(leapMotionAdaptor)
work := func() {
2016-10-17 14:43:04 +08:00
l.On(l.Event("message"), func(data interface{}) {
fmt.Println(data.(leap.Frame))
})
}
robot := gobot.NewRobot("leapBot",
[]gobot.Connection{leapMotionAdaptor},
[]gobot.Device{l},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
}
For more information refer to the leap README:
https://github.com/hybridgroup/gobot/blob/master/platforms/leap/README.md
*/
package leap // import "gobot.io/x/gobot/v2/platforms/leap"