From 6c93f492c705d5e42896fabefd0b5a3ed39c655b Mon Sep 17 00:00:00 2001 From: Benjamin Radovsky Date: Mon, 17 Oct 2016 17:43:04 +1100 Subject: [PATCH] fixed undefined method errors --- platforms/ardrone/doc.go | 2 +- platforms/joystick/doc.go | 16 ++++++++-------- platforms/leap/doc.go | 2 +- platforms/mavlink/doc.go | 4 ++-- platforms/neurosky/doc.go | 14 +++++++------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/platforms/ardrone/doc.go b/platforms/ardrone/doc.go index fa20256b..0063c654 100644 --- a/platforms/ardrone/doc.go +++ b/platforms/ardrone/doc.go @@ -24,7 +24,7 @@ Example: work := func() { drone.TakeOff() - gobot.On(drone.Event("flying"), func(data interface{}) { + drone.On(drone.Event("flying"), func(data interface{}) { gobot.After(3*time.Second, func() { drone.Land() }) diff --git a/platforms/joystick/doc.go b/platforms/joystick/doc.go index d6cd4095..4b99ace5 100644 --- a/platforms/joystick/doc.go +++ b/platforms/joystick/doc.go @@ -28,28 +28,28 @@ Example: ) work := func() { - gobot.On(joystick.Event("square_press"), func(data interface{}) { + joystick.On(joystick.Event("square_press"), func(data interface{}) { fmt.Println("square_press") }) - gobot.On(joystick.Event("square_release"), func(data interface{}) { + joystick.On(joystick.Event("square_release"), func(data interface{}) { fmt.Println("square_release") }) - gobot.On(joystick.Event("triangle_press"), func(data interface{}) { + joystick.On(joystick.Event("triangle_press"), func(data interface{}) { fmt.Println("triangle_press") }) - gobot.On(joystick.Event("triangle_release"), func(data interface{}) { + joystick.On(joystick.Event("triangle_release"), func(data interface{}) { fmt.Println("triangle_release") }) - gobot.On(joystick.Event("left_x"), func(data interface{}) { + joystick.On(joystick.Event("left_x"), func(data interface{}) { fmt.Println("left_x", data) }) - gobot.On(joystick.Event("left_y"), func(data interface{}) { + joystick.On(joystick.Event("left_y"), func(data interface{}) { fmt.Println("left_y", data) }) - gobot.On(joystick.Event("right_x"), func(data interface{}) { + joystick.On(joystick.Event("right_x"), func(data interface{}) { fmt.Println("right_x", data) }) - gobot.On(joystick.Event("right_y"), func(data interface{}) { + joystick.On(joystick.Event("right_y"), func(data interface{}) { fmt.Println("right_y", data) }) } diff --git a/platforms/leap/doc.go b/platforms/leap/doc.go index 62a228ba..c91d091f 100644 --- a/platforms/leap/doc.go +++ b/platforms/leap/doc.go @@ -26,7 +26,7 @@ Example: l := leap.NewDriver(leapMotionAdaptor) work := func() { - gobot.On(l.Event("message"), func(data interface{}) { + l.On(l.Event("message"), func(data interface{}) { fmt.Println(data.(leap.Frame)) }) } diff --git a/platforms/mavlink/doc.go b/platforms/mavlink/doc.go index ffff28cd..0010037a 100644 --- a/platforms/mavlink/doc.go +++ b/platforms/mavlink/doc.go @@ -24,7 +24,7 @@ Example: iris := mavlink.NewDriver(adaptor) work := func() { - gobot.Once(iris.Event("packet"), func(data interface{}) { + iris.Once(iris.Event("packet"), func(data interface{}) { packet := data.(*common.MAVLinkPacket) dataStream := common.NewRequestDataStream(100, @@ -39,7 +39,7 @@ Example: )) }) - gobot.On(iris.Event("message"), func(data interface{}) { + iris.On(iris.Event("message"), func(data interface{}) { if data.(common.MAVLinkMessage).Id() == 30 { message := data.(*common.Attitude) fmt.Println("Attitude") diff --git a/platforms/neurosky/doc.go b/platforms/neurosky/doc.go index 07b8e554..4fa6ba0e 100644 --- a/platforms/neurosky/doc.go +++ b/platforms/neurosky/doc.go @@ -23,25 +23,25 @@ Example: neuro := neurosky.NewDriver(adaptor) work := func() { - gobot.On(neuro.Event("extended"), func(data interface{}) { + neuro.On(neuro.Event("extended"), func(data interface{}) { fmt.Println("Extended", data) }) - gobot.On(neuro.Event("signal"), func(data interface{}) { + neuro.On(neuro.Event("signal"), func(data interface{}) { fmt.Println("Signal", data) }) - gobot.On(neuro.Event("attention"), func(data interface{}) { + neuro.On(neuro.Event("attention"), func(data interface{}) { fmt.Println("Attention", data) }) - gobot.On(neuro.Event("meditation"), func(data interface{}) { + neuro.On(neuro.Event("meditation"), func(data interface{}) { fmt.Println("Meditation", data) }) - gobot.On(neuro.Event("blink"), func(data interface{}) { + neuro.On(neuro.Event("blink"), func(data interface{}) { fmt.Println("Blink", data) }) - gobot.On(neuro.Event("wave"), func(data interface{}) { + neuro.On(neuro.Event("wave"), func(data interface{}) { fmt.Println("Wave", data) }) - gobot.On(neuro.Event("eeg"), func(data interface{}) { + neuro.On(neuro.Event("eeg"), func(data interface{}) { eeg := data.(neurosky.EEG) fmt.Println("Delta", eeg.Delta) fmt.Println("Theta", eeg.Theta)