From d7794518a10a6ed040df262153975b0870df6952 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Fri, 14 Jun 2024 11:55:14 +0200 Subject: [PATCH] examples: correct all usage of ps3 joystick reads, which are now int instead of int16 Signed-off-by: deadprogram --- examples/ardrone_ps3.go | 8 ++++---- examples/bebop_ps3.go | 8 ++++---- examples/bebop_ps3_video.go | 8 ++++---- examples/bleclient_minidrone_mambo_ps3.go | 8 ++++---- examples/bleclient_minidrone_ps3.go | 8 ++++---- examples/tello_ps3.go | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/ardrone_ps3.go b/examples/ardrone_ps3.go index f0067b17..fa3bbfb4 100644 --- a/examples/ardrone_ps3.go +++ b/examples/ardrone_ps3.go @@ -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) }) diff --git a/examples/bebop_ps3.go b/examples/bebop_ps3.go index 5974b056..9047b2f7 100644 --- a/examples/bebop_ps3.go +++ b/examples/bebop_ps3.go @@ -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) }) diff --git a/examples/bebop_ps3_video.go b/examples/bebop_ps3_video.go index 307b4dd5..5c70bac9 100644 --- a/examples/bebop_ps3_video.go +++ b/examples/bebop_ps3_video.go @@ -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) }) diff --git a/examples/bleclient_minidrone_mambo_ps3.go b/examples/bleclient_minidrone_mambo_ps3.go index a977b89a..25522f0b 100644 --- a/examples/bleclient_minidrone_mambo_ps3.go +++ b/examples/bleclient_minidrone_mambo_ps3.go @@ -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) }) diff --git a/examples/bleclient_minidrone_ps3.go b/examples/bleclient_minidrone_ps3.go index 409c2486..1401e64e 100644 --- a/examples/bleclient_minidrone_ps3.go +++ b/examples/bleclient_minidrone_ps3.go @@ -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) }) diff --git a/examples/tello_ps3.go b/examples/tello_ps3.go index 267d5be9..ce63d31b 100644 --- a/examples/tello_ps3.go +++ b/examples/tello_ps3.go @@ -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) })