mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-13 19:29:10 +08:00
fix Port calls in leap motion adapter
"Message" should be capitalized to match event in driver fix capitalization again (in example) last event capitalization fix: hands example
This commit is contained in:
parent
167aa1091b
commit
cdb26ad036
@ -14,7 +14,7 @@ func main() {
|
||||
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
|
||||
|
||||
work := func() {
|
||||
gobot.On(l.Event("message"), func(data interface{}) {
|
||||
gobot.On(l.Event("Message"), func(data interface{}) {
|
||||
fmt.Println(data.(leap.Frame))
|
||||
})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
|
||||
|
||||
work := func() {
|
||||
gobot.On(l.Event("message"), func(data interface{}) {
|
||||
gobot.On(l.Event("Message"), func(data interface{}) {
|
||||
printHands(data.(leap.Frame))
|
||||
})
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ func main() {
|
||||
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
|
||||
|
||||
work := func() {
|
||||
gobot.On(l.Event("message"), func(data interface{}) {
|
||||
gobot.On(l.Event("Message"), func(data interface{}) {
|
||||
fmt.Println(data.(leap.Frame))
|
||||
})
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ func NewLeapMotionAdaptor(name string, port string) *LeapMotionAdaptor {
|
||||
port,
|
||||
),
|
||||
connect: func(l *LeapMotionAdaptor) {
|
||||
origin := fmt.Sprintf("http://%v", l.Port)
|
||||
url := fmt.Sprintf("ws://%v/v3.json", l.Port)
|
||||
origin := fmt.Sprintf("http://%v", l.Port())
|
||||
url := fmt.Sprintf("ws://%v/v3.json", l.Port())
|
||||
ws, err := websocket.Dial(url, "", origin)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user