Skip to content

Commit

Permalink
examples: add Firmata blink metal example
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 18, 2016
1 parent 68662f8 commit e08e8b0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/firmata_blink_metal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"time"

"github.com/hybridgroup/gobot/drivers/gpio"
"github.com/hybridgroup/gobot/platforms/firmata"
)

// 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() {
f := firmata.NewAdaptor("/dev/ttyACM0")
f.Connect()

led := gpio.NewLedDriver(f, "13")
led.Start()

for {
led.Toggle()
time.Sleep(1000 * time.Millisecond)
}
}

0 comments on commit e08e8b0

Please sign in to comment.