1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00

49 lines
934 B
Go
Raw Normal View History

/*
2014-10-28 14:52:59 -07:00
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:
2014-10-28 14:52:59 -07:00
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.NewMaster()
leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437")
l := leap.NewDriver(leapMotionAdaptor)
work := func() {
2016-10-17 17:43:04 +11: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,
)
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