Skip to content

Commit

Permalink
Add example for Edison blink demo without gobot initialization.
Browse files Browse the repository at this point in the history
This example shows how to use gobot as another golang library.

Signed-off-by: Erich Cordoba <[email protected]>
  • Loading branch information
ericho committed Aug 24, 2016
1 parent 64d520c commit 3b6bf4d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/edison_blink_without_all_gobot_framework.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"github.com/hybridgroup/gobot/platforms/gpio"
"github.com/hybridgroup/gobot/platforms/intel-iot/edison"
"time"
)

// Example of a simple led toggle without the initialization of
// the entire gobot framework.
// This might be useful if you want to use gobot as another
// golang library to interact with sensors and other devices.
func main() {
e := edison.NewEdisonAdaptor("edison")
led := gpio.NewLedDriver(e, "led", "13")
e.Connect()
led.Start()
for {
led.Toggle()
time.Sleep(1000 * time.Millisecond)
}
}

0 comments on commit 3b6bf4d

Please sign in to comment.