hybridgroup.gobot/platforms/leap
Adrian Zankich 3d8408e390 Update leap package error handling 2014-11-19 15:11:00 -08:00
..
test/support WIP project restructure 2014-04-29 13:20:32 -07:00
LICENSE WIP project restructure 2014-04-29 13:20:32 -07:00
README.md fix "message" capitalization in leap driver 2014-07-15 12:15:37 -07:00
doc.go Update docs 2014-10-28 14:52:59 -07:00
leap_motion_adaptor.go Update leap package error handling 2014-11-19 15:11:00 -08:00
leap_motion_adaptor_test.go Update leap package error handling 2014-11-19 15:11:00 -08:00
leap_motion_driver.go Update leap package error handling 2014-11-19 15:11:00 -08:00
leap_motion_driver_test.go Update leap package error handling 2014-11-19 15:11:00 -08:00
parser.go Increase leap test coverage 2014-11-07 13:15:45 -08:00

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()
}