hybridgroup.gobot/platforms/firmata/doc.go

43 lines
868 B
Go
Raw Permalink Normal View History

2014-10-18 01:42:07 +08:00
/*
2014-10-29 05:52:59 +08:00
Package firmata provides the Gobot adaptor for microcontrollers that support the Firmata protocol.
2014-10-18 01:42:07 +08:00
Installing:
go get -d -u gobot.io/x/gobot/... && go get gobot.io/x/gobot/platforms/firmata
2014-10-18 01:42:07 +08:00
Example:
2014-10-18 01:42:07 +08:00
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
2014-10-18 01:42:07 +08:00
)
func main() {
firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0")
led := gpio.NewLedDriver(firmataAdaptor, "13")
2014-10-18 01:42:07 +08:00
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
})
}
robot := gobot.NewRobot("bot",
[]gobot.Connection{firmataAdaptor},
[]gobot.Device{led},
work,
)
robot.Start()
2014-10-18 01:42:07 +08:00
}
For further information refer to firmata readme:
https://github.com/hybridgroup/gobot/blob/master/platforms/firmata/README.md
2014-10-18 01:42:07 +08:00
*/
package firmata // import "gobot.io/x/gobot/platforms/firmata"