gobot.io/x/gobot/v2@v2.1.0/platforms/parrot/ardrone/doc.go (about)

     1  /*
     2  Package ardrone provides the Gobot adaptor and driver for the Parrot Ardrone.
     3  
     4  Installing:
     5  
     6  	go get -d -u gobot.io/x/gobot/v2/... && go install gobot.io/x/gobot/v2/platforms/parrot/ardrone
     7  
     8  Example:
     9  
    10  	package main
    11  
    12  	import (
    13  		"time"
    14  
    15  		"gobot.io/x/gobot/v2"
    16  		"gobot.io/x/gobot/v2/platforms/parrot/ardrone"
    17  	)
    18  
    19  	func main() {
    20  		ardroneAdaptor := ardrone.NewAdaptor()
    21  		drone := ardrone.NewDriver(ardroneAdaptor)
    22  
    23  		work := func() {
    24  			drone.TakeOff()
    25  			drone.On(drone.Event("flying"), func(data interface{}) {
    26  				gobot.After(3*time.Second, func() {
    27  					drone.Land()
    28  				})
    29  			})
    30  		}
    31  
    32  		robot := gobot.NewRobot("drone",
    33  			[]gobot.Connection{ardroneAdaptor},
    34  			[]gobot.Device{drone},
    35  			work,
    36  		)
    37  
    38  		robot.Start()
    39  	}
    40  
    41  For more information refer to the ardrone README:
    42  https://github.com/hybridgroup/gobot/tree/master/platforms/parrot/ardrone/README.md
    43  */
    44  package ardrone // import "gobot.io/x/gobot/v2/platforms/parrot/ardrone"