1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00
hybridgroup.gobot/examples/particle_events.go
deadprogram 4230d2ab2f examples: remove Master unless needed for less code
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-10-18 21:08:25 +02:00

29 lines
465 B
Go

package main
import (
"fmt"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/platforms/particle"
)
func main() {
core := particle.NewAdaptor("DEVICE_ID", "ACCESS_TOKEN")
work := func() {
if stream, err := core.EventStream("all", ""); err != nil {
fmt.Println(err)
} else {
// TODO: some other way to handle this
fmt.Println(stream)
}
}
robot := gobot.NewRobot("spark",
[]gobot.Connection{core},
work,
)
robot.Start()
}