Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Gobot, PS3 joystick controller (Bluetooth mode) does not work simultaneously with BLE connection #743

Open
bhardw1m opened this issue Apr 3, 2020 · 0 comments

Comments

@bhardw1m
Copy link

bhardw1m commented Apr 3, 2020

Hello,
Whenever I run my 'go' program, the bluetooth PS3 controller disconnects (i.e the red light on the controller turns off). However, the PS3 controller works fine with independent Joystick Go program. But when tried with other BLE connection (eg. BB8), the connection breaks with the joystick. Also note that, in Cylon js both PS3 controller and BB8 works simultaneously.

I want to drive my Sphero BB8 with PS3 controller in a wireless mode in Gobot but it doesn't work. Please check my code below and guide me how to resolve this.

package main
import (
"fmt"
"os"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/joystick"
"gobot.io/x/gobot/platforms/ble"
"gobot.io/x/gobot/platforms/sphero/bb8"
)

func main() {
joystickAdaptor := joystick.NewAdaptor()
stick := joystick.NewDriver(joystickAdaptor, joystick.Dualshock3)
bleAdaptor := ble.NewClientAdaptor(os.Args[1])
bb8 := bb8.NewDriver(bleAdaptor)

work := func() {
		stick.On(joystick.SquarePress, func(data interface{}) {
		bb8.Roll(80, 0)
	})
	
}

robot := gobot.NewRobot("joystickBot",
	[]gobot.Connection{joystickAdaptor, bleAdaptor},
	[]gobot.Device{stick, bb8},
	work,
)

robot.Start()

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant