2014-10-17 10:05:21 -05:00
|
|
|
/*
|
2016-11-06 10:46:34 +01:00
|
|
|
Package particle provides the Gobot adaptor for the Particle Photon and Electron.
|
2014-10-17 10:05:21 -05:00
|
|
|
|
|
|
|
Installing:
|
|
|
|
|
2023-06-04 18:36:55 +02:00
|
|
|
Please refer to the main [README.md](https://github.com/hybridgroup/gobot/blob/release/README.md)
|
2014-10-17 10:05:21 -05:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2023-05-20 14:25:21 +02:00
|
|
|
"gobot.io/x/gobot/v2"
|
|
|
|
"gobot.io/x/gobot/v2/drivers/gpio"
|
|
|
|
"gobot.io/x/gobot/v2/platforms/particle"
|
2014-10-17 10:05:21 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-10-01 18:28:28 +02:00
|
|
|
core := paticle.NewAdaptor("device_id", "access_token")
|
|
|
|
led := gpio.NewLedDriver(core, "D7")
|
2014-10-17 10:05:21 -05:00
|
|
|
|
|
|
|
work := func() {
|
|
|
|
gobot.Every(1*time.Second, func() {
|
|
|
|
led.Toggle()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-11-06 10:46:34 +01:00
|
|
|
robot := gobot.NewRobot("particle",
|
2016-10-01 18:28:28 +02:00
|
|
|
[]gobot.Connection{core},
|
2014-10-17 10:05:21 -05:00
|
|
|
[]gobot.Device{led},
|
|
|
|
work,
|
|
|
|
)
|
|
|
|
|
2016-10-18 21:37:10 +02:00
|
|
|
robot.Start()
|
2014-10-17 10:05:21 -05:00
|
|
|
}
|
|
|
|
|
2016-10-01 18:28:28 +02:00
|
|
|
For further information refer to Particle readme:
|
2016-12-21 10:55:03 +01:00
|
|
|
https://github.com/hybridgroup/gobot/blob/master/platforms/particle/README.md
|
2014-10-17 10:05:21 -05:00
|
|
|
*/
|
2023-05-20 14:25:21 +02:00
|
|
|
package particle // import "gobot.io/x/gobot/v2/platforms/particle"
|