From fdf5576e15ce14a9755062eac2c8655950d80850 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 24 Oct 2015 15:50:44 -0700 Subject: [PATCH] Needed to setup the event handler before the method that triggers it --- examples/bebop.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/bebop.go b/examples/bebop.go index 0b01f571..7394bc6e 100644 --- a/examples/bebop.go +++ b/examples/bebop.go @@ -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",