Needed to setup the event handler before the method that triggers it

This commit is contained in:
deadprogram 2015-10-24 15:50:44 -07:00
parent 59dbd6d15c
commit fdf5576e15
1 changed files with 3 additions and 2 deletions

View File

@ -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",