You are on page 1of 1

package main

import (
"time"

"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
)

func main() {
firmataAdaptor := firmata.NewAdaptor( "/dev/ttyACM0")
led := gpio.NewLedDriver(firmataAdaptor, "13")

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

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

robot.Start()
}