gobot.io/x/gobot/v2@v2.1.0/platforms/leap/doc.go (about) 1 /* 2 Package leap provides the Gobot adaptor and driver for the Leap Motion. 3 4 Installing: 5 6 * First install the [Leap Motion Software](https://www.leapmotion.com/setup). 7 * Then install the package: 8 9 go get gobot.io/x/gobot/v2/platforms/leap 10 11 Example: 12 13 package main 14 15 import ( 16 "fmt" 17 18 "gobot.io/x/gobot/v2" 19 "gobot.io/x/gobot/v2/platforms/leap" 20 ) 21 22 func main() { 23 leapMotionAdaptor := leap.NewAdaptor("127.0.0.1:6437") 24 l := leap.NewDriver(leapMotionAdaptor) 25 26 work := func() { 27 l.On(l.Event("message"), func(data interface{}) { 28 fmt.Println(data.(leap.Frame)) 29 }) 30 } 31 32 robot := gobot.NewRobot("leapBot", 33 []gobot.Connection{leapMotionAdaptor}, 34 []gobot.Device{l}, 35 work, 36 ) 37 38 robot.Start() 39 } 40 41 For more information refer to the leap README: 42 https://github.com/hybridgroup/gobot/blob/master/platforms/leap/README.md 43 */ 44 package leap // import "gobot.io/x/gobot/v2/platforms/leap"