mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-13 19:29:10 +08:00
The take-off-before-event-handling bug again
This commit is contained in:
parent
274cb02647
commit
78bf872281
@ -26,12 +26,12 @@ func main() {
|
||||
drone := ardrone.NewArdroneDriver(ardroneAdaptor, "Drone")
|
||||
|
||||
work := func() {
|
||||
drone.TakeOff()
|
||||
gobot.On(drone.Event("flying"), func(data interface{}) {
|
||||
gobot.After(3*time.Second, func() {
|
||||
drone.Land()
|
||||
})
|
||||
})
|
||||
drone.TakeOff()
|
||||
}
|
||||
|
||||
robot := gobot.NewRobot("drone",
|
||||
|
Loading…
x
Reference in New Issue
Block a user