1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-01 13:48:57 +08:00

38 lines
484 B
Go
Raw Normal View History

2013-10-22 16:45:31 -07:00
package main
import (
2013-11-13 20:47:21 -08:00
. "gobot"
"time"
2013-10-22 16:45:31 -07:00
)
func main() {
2013-11-13 20:47:21 -08:00
beaglebone := new(Beaglebone)
beaglebone.Name = "Beaglebone"
led := NewLed(beaglebone)
led.Driver = Driver{
Name: "led",
Pin: "P9_12",
}
connections := []interface{}{
beaglebone,
}
devices := []interface{}{
led,
}
work := func() {
Every(1000*time.Millisecond, func() { led.Toggle() })
}
robot := Robot{
Connections: connections,
Devices: devices,
Work: work,
}
robot.Start()
2013-10-22 16:45:31 -07:00
}