27 lines
526 B
Go
27 lines
526 B
Go
package main
|
|
|
|
import (
|
|
"github.com/hybridgroup/gobot"
|
|
"github.com/hybridgroup/gobot/api"
|
|
"github.com/hybridgroup/gobot/platforms/digispark"
|
|
"github.com/hybridgroup/gobot/platforms/gpio"
|
|
)
|
|
|
|
func main() {
|
|
gbot := gobot.NewGobot()
|
|
|
|
api.NewAPI(gbot).Start()
|
|
|
|
digisparkAdaptor := digispark.NewDigisparkAdaptor("Digispark")
|
|
led := gpio.NewLedDriver(digisparkAdaptor, "led", "0")
|
|
|
|
robot := gobot.NewRobot("digispark",
|
|
[]gobot.Connection{digisparkAdaptor},
|
|
[]gobot.Device{led},
|
|
)
|
|
|
|
gbot.AddRobot(robot)
|
|
|
|
gbot.Start()
|
|
}
|