hybridgroup.gobot/platforms/leap
Adrian Zankich 84363c6699 Rename Expect to Assert and add Refute function 2014-07-17 11:41:47 -07:00
..
docs WIP project restructure 2014-04-29 13:20:32 -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
leap_motion_adaptor.go fix Port calls in leap motion adapter 2014-07-15 12:14:59 -07: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 fix "message" capitalization in leap driver 2014-07-15 12:15:37 -07:00
leap_motion_driver_test.go Rename Expect to Assert and add Refute function 2014-07-17 11:41:47 -07:00
parser.go WIP project restructure 2014-04-29 13:20:32 -07: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()
}