Skip to content

Commit

Permalink
Fix robot command initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Jun 8, 2014
1 parent e1053fb commit 851b9bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
nil,
nil,
func() {
gobot.Every(0.5*time.Second, func() { fmt.Println("Greetings human") })
gobot.Every(500*time.Millisecond, func() { fmt.Println("Greetings human") })
},
)

Expand Down
2 changes: 1 addition & 1 deletion examples/hello_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func Hello(params map[string]interface{}) string {
}

func main() {
master := gobot.GobotMaster()
master := gobot.NewGobot()
api.NewApi(master).Start()

hello := gobot.NewRobot("hello", nil, nil, nil)
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_api_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func Hello(params map[string]interface{}) string {
}

func main() {
master := gobot.GobotMaster()
master := gobot.NewGobot()

server := api.NewApi(master)
server.Username = "gort"
Expand Down
2 changes: 1 addition & 1 deletion robot.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func NewRobot(name string, c []Connection, d []Device, work func()) *Robot {
}
r.initName()
log.Println("Initializing Robot", r.Name, "...")
r.initCommands()
r.initConnections(c)
r.initDevices(d)
return r
}

func (r *Robot) Start() {
log.Println("Starting Robot", r.Name, "...")
r.initCommands()
if err := r.Connections().Start(); err != nil {
panic("Could not start connections")
}
Expand Down

0 comments on commit 851b9bc

Please sign in to comment.