gobot.io/x/gobot/v2@v2.1.0/platforms/particle/doc.go (about)

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