forked from hybridgroup/gobot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
42 lines (31 loc) · 839 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Package particle provides the Gobot adaptor for the Particle Photon and Electron.
Installing:
go get gobot.io/x/gobot && go install gobot.io/x/gobot/platforms/particle
Example:
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/particle"
)
func main() {
core := paticle.NewAdaptor("device_id", "access_token")
led := gpio.NewLedDriver(core, "D7")
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
})
}
robot := gobot.NewRobot("particle",
[]gobot.Connection{core},
[]gobot.Device{led},
work,
)
robot.Start()
}
For further information refer to Particle readme:
https://github.com/hybridgroup/gobot/blob/master/platforms/particle/README.md
*/
package particle // import "gobot.io/x/gobot/platforms/particle"