hybridgroup.gobot/platforms/particle
Ron Evans 7ca9db598f docs: update copyright date to 2018
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-02-14 08:24:39 +01:00
..
LICENSE docs: update copyright date to 2018 2018-02-14 08:24:39 +01:00
README.md docs: correct installation instructions to match latest versions 2017-06-15 14:04:08 +02:00
adaptor.go particle: increase test coverage 2017-04-10 04:50:45 +02:00
adaptor_test.go particle: increase test coverage 2017-04-10 04:50:45 +02:00
doc.go docs: correct Particle README link 2016-12-21 10:55:03 +01:00

README.md

Particle

The Particle Photon and Particle Electron are connected microcontrollers from Particle (http://particle.io), the company formerly known as Spark Devices. The Photon uses a Wi-Fi connection to the Particle cloud, and the Electron uses a 3G wireless connection. Once the Photon or Electron connects to the network, it automatically connects with a central server (the "Particle Cloud") and stays connected so it can be controlled from external systems, such as a Gobot program. To run Gobot programs please make sure you are running default Tinker firmware on the Photon or Electron.

For more info about the Particle platform go to https://www.particle.io/

How to Install

Installing Gobot with Particle support is pretty easy.

go get -d -u gobot.io/x/gobot/...

How to Use

package main

import (
	"time"

	"gobot.io/x/gobot"
	"gobot.io/x/gobot/drivers/gpio"
	"gobot.io/x/gobot/platforms/particle"
)

func main() {
	core := particle.NewAdaptor("device_id", "access_token")
	led := gpio.NewLedDriver(core, "D7")

	work := func() {
		gobot.Every(1*time.Second, func() {
			led.Toggle()
		})
	}

	robot := gobot.NewRobot("spark",
		[]gobot.Connection{core},
		[]gobot.Device{led},
		work,
	)

	robot.Start()
}