Skip to content

Commit

Permalink
examples: correct all usage of ps3 joystick reads, which are now int …
Browse files Browse the repository at this point in the history
…instead of int16 (#1085)

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram authored Jan 17, 2025
1 parent 50da9ae commit 270044e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions examples/ardrone_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ func main() {
})

_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down
8 changes: 4 additions & 4 deletions examples/bebop_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ func main() {
})

_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down
8 changes: 4 additions & 4 deletions examples/bebop_ps3_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@ func main() {
}
})
_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down
8 changes: 4 additions & 4 deletions examples/bleclient_minidrone_mambo_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,22 @@ func main() {
})

_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down
8 changes: 4 additions & 4 deletions examples/bleclient_minidrone_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ func main() {
})

_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down
8 changes: 4 additions & 4 deletions examples/tello_ps3.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@ func main() {
})

_ = stick.On(joystick.LeftX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftX.Store(val)
})

_ = stick.On(joystick.LeftY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
leftY.Store(val)
})

_ = stick.On(joystick.RightX, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightX.Store(val)
})

_ = stick.On(joystick.RightY, func(data interface{}) {
val := float64(data.(int16))
val := float64(data.(int))
rightY.Store(val)
})

Expand Down

0 comments on commit 270044e

Please sign in to comment.