Skip to content

Commit

Permalink
Needed to setup the event handler before the method that triggers it
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Oct 24, 2015
1 parent 59dbd6d commit fdf5576
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/bebop.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ func main() {
drone := bebop.NewBebopDriver(bebopAdaptor, "Drone")

work := func() {
drone.HullProtection(true)
drone.TakeOff()
gobot.On(drone.Event("flying"), func(data interface{}) {
gobot.After(3*time.Second, func() {
drone.Land()
})
})

drone.HullProtection(true)
drone.TakeOff()
}

robot := gobot.NewRobot("drone",
Expand Down

0 comments on commit fdf5576

Please sign in to comment.