hybridgroup.gobot/platforms/leap
Adrian Zankich fd24e6a9fe Update docs 2014-10-28 14:52:59 -07: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 Adding godocs information to leap package 2014-10-22 10:10:08 -05:00
leap_motion_adaptor_test.go Rename Expect to Assert and add Refute function 2014-07-17 11:41:47 -07:00
leap_motion_driver.go Adding godocs information to leap package 2014-10-22 10:10:08 -05:00
leap_motion_driver_test.go Rename Expect to Assert and add Refute function 2014-07-17 11:41:47 -07:00
parser.go Adding godocs information to leap package 2014-10-22 10:10:08 -05: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()
}