hybridgroup.gobot/examples/digispark_api.go

27 lines
497 B
Go

package main
import (
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/api"
"github.com/hybridgroup/gobot/drivers/gpio"
"github.com/hybridgroup/gobot/platforms/digispark"
)
func main() {
gbot := gobot.NewGobot()
api.NewAPI(gbot).Start()
digisparkAdaptor := digispark.NewAdaptor()
led := gpio.NewLedDriver(digisparkAdaptor, "0")
robot := gobot.NewRobot("digispark",
[]gobot.Connection{digisparkAdaptor},
[]gobot.Device{led},
)
gbot.AddRobot(robot)
gbot.Start()
}