Needed to setup the event handler before the method that triggers it
This commit is contained in:
parent
59dbd6d15c
commit
fdf5576e15
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue