2014-04-28 04:23:15 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hybridgroup/gobot"
|
2014-05-22 20:13:38 -07:00
|
|
|
"github.com/hybridgroup/gobot/api"
|
|
|
|
"github.com/hybridgroup/gobot/platforms/digispark"
|
|
|
|
"github.com/hybridgroup/gobot/platforms/gpio"
|
2014-04-28 04:23:15 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2014-06-06 18:11:26 -07:00
|
|
|
gbot := gobot.NewGobot()
|
2014-07-08 18:36:14 -07:00
|
|
|
|
2014-06-10 15:16:11 -07:00
|
|
|
api.NewAPI(gbot).Start()
|
2014-04-28 04:23:15 -07:00
|
|
|
|
2014-05-22 20:13:38 -07:00
|
|
|
digisparkAdaptor := digispark.NewDigisparkAdaptor("Digispark")
|
2014-07-09 16:51:00 -07:00
|
|
|
led := gpio.NewLedDriver(digisparkAdaptor, "led", "0")
|
2014-07-08 18:36:14 -07:00
|
|
|
|
|
|
|
robot := gobot.NewRobot("digispark",
|
|
|
|
[]gobot.Connection{digisparkAdaptor},
|
|
|
|
[]gobot.Device{led},
|
|
|
|
)
|
|
|
|
|
|
|
|
gbot.AddRobot(robot)
|
2014-04-28 04:23:15 -07:00
|
|
|
|
2014-05-22 20:13:38 -07:00
|
|
|
gbot.Start()
|
2014-04-28 04:23:15 -07:00
|
|
|
}
|