Update examples
This commit is contained in:
parent
f2c255d4fb
commit
cf9ed8b9be
|
@ -1,32 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/hybridgroup/gobot"
|
||||
"github.com/hybridgroup/gobot/firmata"
|
||||
"github.com/hybridgroup/gobot/gpio"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
firmata := new(firmata.Adaptor)
|
||||
firmata.Name = "firmata"
|
||||
firmata.Port = "/dev/ttyACM0"
|
||||
|
||||
led := gpio.NewLed(firmata)
|
||||
led.Name = "led"
|
||||
led.Pin = "13"
|
||||
|
||||
work := func() {
|
||||
gobot.Every("1s", func() {
|
||||
led.Toggle()
|
||||
})
|
||||
}
|
||||
|
||||
robot := gobot.Robot{
|
||||
Connections: []gobot.Connection{firmata},
|
||||
Devices: []gobot.Device{led},
|
||||
Work: work,
|
||||
}
|
||||
|
||||
robot.Start()
|
||||
}
|
Loading…
Reference in New Issue