1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-11 19:29:20 +08:00
2014-06-12 16:22:34 -07:00
..
2014-06-12 16:22:34 -07:00
2014-06-10 15:16:11 -07:00
2014-06-10 15:16:11 -07:00
2014-04-29 13:20:32 -07:00
2014-06-09 19:01:53 -07:00
2014-04-29 13:20:32 -07:00

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/platforms/firmata

Example

package main

import (
	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/firmata"
	"github.com/hybridgroup/gobot/platforms/gpio"
	"time"
)

func main() {
	gbot := gobot.NewGobot()
	adaptor := firmata.NewFirmataAdaptor("myFirmata", "/dev/ttyACM0")
	led := gpio.NewLedDriver(adaptor, "myLed", "13")
	work := func() {
		gobot.Every(1*time.Second, func() {
			led.Toggle()
		})
	}
	gbot.Robots = append(gbot.Robots,
		gobot.NewRobot("blinkBot", []gobot.Connection{adaptor}, []gobot.Device{led}, work))
	gbot.Start()
}

Hardware Support

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

More devices are coming soon...