hybridgroup.gobot/platforms/leap
Adrian Zankich abc1f0b201 Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -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 platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
leap_motion_adaptor_test.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
leap_motion_driver.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
leap_motion_driver_test.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -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()
}