1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-06 19:29:15 +08:00

39 lines
531 B
Go
Raw Normal View History

2013-10-22 16:45:31 -07:00
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()
}