2014-10-17 10:43:48 -05:00
|
|
|
/*
|
2014-10-28 14:52:59 -07:00
|
|
|
Package leap provides the Gobot adaptor and driver for the Leap Motion.
|
2014-10-17 10:43:48 -05:00
|
|
|
|
|
|
|
Installing:
|
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
|
2023-06-18 18:10:46 +02:00
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Install the [Leap Motion Software](https://www.leapmotion.com/setup).
|
2014-10-17 10:43:48 -05:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2023-05-20 14:25:21 +02:00
|
|
|
"gobot.io/x/gobot/v2"
|
|
|
|
"gobot.io/x/gobot/v2/platforms/leap"
|
2014-10-17 10:43:48 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-09-25 21:36:01 +02:00
|
|
|
leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437")
|
|
|
|
l := leap.NewDriver(leapMotionAdaptor)
|
2014-10-17 10:43:48 -05:00
|
|
|
|
|
|
|
work := func() {
|
2016-10-17 17:43:04 +11:00
|
|
|
l.On(l.Event("message"), func(data interface{}) {
|
2014-10-17 10:43:48 -05:00
|
|
|
fmt.Println(data.(leap.Frame))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
robot := gobot.NewRobot("leapBot",
|
|
|
|
[]gobot.Connection{leapMotionAdaptor},
|
|
|
|
[]gobot.Device{l},
|
|
|
|
work,
|
|
|
|
)
|
|
|
|
|
2016-10-18 21:37:10 +02:00
|
|
|
robot.Start()
|
2014-10-17 10:43:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
For more information refer to the leap README:
|
2016-12-21 10:53:05 +01:00
|
|
|
https://github.com/hybridgroup/gobot/blob/master/platforms/leap/README.md
|
2014-10-17 10:43:48 -05:00
|
|
|
*/
|
2023-05-20 14:25:21 +02:00
|
|
|
package leap // import "gobot.io/x/gobot/v2/platforms/leap"
|