hybridgroup.gobot/platforms/leap
Adrian Zankich aed6b39bb6 Update test formatting 2014-06-13 16:01:39 -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 Update READMEs for each platform 2014-06-09 19:01:53 -07:00
leap_motion_adaptor.go Make golint happy 2014-06-10 15:16:11 -07:00
leap_motion_adaptor_test.go Update test formatting 2014-06-13 16:01:39 -07:00
leap_motion_driver.go Use new Event type for events 2014-06-11 11:37:20 -07:00
leap_motion_driver_test.go Update test formatting 2014-06-13 16:01:39 -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/platforms/leap

Example

package main

import (
	"fmt"
	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/leap"
)

func main() {
	gbot := gobot.NewGobot()
	adaptor := leap.NewLeapMotionAdaptor("leap", "127.0.0.1:6437")
	l := leap.NewLeapMotionDriver(adaptor, "leap")

	work := func() {
		gobot.On(l.Events["Message"], func(data interface{}) {
			fmt.Println(data.(leap.Frame))
		})
	}

	gbot.Robots = append(gbot.Robots, gobot.NewRobot(
		"leapBot", []gobot.Connection{adaptor}, []gobot.Device{l}, work))

	gbot.Start()
}