hybridgroup.gobot/platforms/firmata
Adrian Zankich abc1f0b201 Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
..
LICENSE WIP project restructure 2014-04-29 13:20:32 -07:00
README.md Update READMEs 2014-07-10 17:02:00 -07:00
doc.go Update docs 2014-10-28 14:52:59 -07:00
firmata.go Adding godocs to firmata package 2014-10-22 09:49:19 -05:00
firmata_adaptor.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
firmata_adaptor_test.go Update platforms to support the new Driver and Adaptor interfaces 2014-11-16 12:25:48 -08:00
firmata_test.go Adding godocs to firmata package 2014-10-22 09:49:19 -05:00

README.md

Firmata

This package provides the adaptor for microcontrollers such as Arduino that support the Firmata protocol

Getting Started

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/gobot/platforms/firmata

Example

package main

import (
	"time"

	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/firmata"
	"github.com/hybridgroup/gobot/platforms/gpio"
)

func main() {
	gbot := gobot.NewGobot()

	firmataAdaptor := firmata.NewFirmataAdaptor("arduino", "/dev/ttyACM0")
	led := gpio.NewLedDriver(firmataAdaptor, "led", "13")

	work := func() {
		gobot.Every(1*time.Second, func() {
			led.Toggle()
		})
	}

	robot := gobot.NewRobot("bot",
		[]gobot.Connection{firmataAdaptor},
		[]gobot.Device{led},
		work,
	)

	gbot.AddRobot(robot)

	gbot.Start()
}

Hardware Support

The following firmata devices have been tested and are currently supported:

More devices are coming soon...