1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-02 22:17:12 +08:00
2013-10-22 16:45:31 -07:00

39 lines
531 B
Go

package main
import (
. "gobot"
"time"
"fmt"
)
func main() {
connections := []Connection{
Connection {
Name: "arduino",
Adaptor: "arduino",
Port: "/dev/ttyACM0",
},
}
devices := []Device{
Device{
Name: "led",
Driver: "arduino",
Pin: "13",
},
}
work := func(){
Every(300 * time.Millisecond, func(){ fmt.Println("Greetings Human")})
}
robot := Robot{
Connections: connections,
Devices: devices,
Work: work,
}
robot.Start()
}