2 spike hubs connected to 1 xbox controller #1884
Unanswered
Paralysis-03
asked this question in
Q&A
Replies: 3 comments 3 replies
-
Hello, Maybe the an example can help: in discussions Show and tell: Bert |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here is an example of controlling two hubs with one Xbox Controller. The same technique works for SPIKE Prime. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I keep getting an error:
how do i fix it? This is my code for the reciving hub: from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor,
from pybricks.parameters import Axis, Button, Color, Direction, Port, Side, Stop
from pybricks.tools import wait,
hub = PrimeHub(top_side=Axis.Z, front_side=-Axis.Y, broadcast_channel=0, observe_channels=[5])
claw = Motor(Port.A, Direction.CLOCKWISE)
# Initialize variables.
claw_speed = 0
# The main program starts here.
while True:
claw_speed = hub.ble.observe(5) or [0] * 0
if claw_speed:
claw.run(claw_speed * 8)
else:
claw.stop()
wait(100) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have run out of ports on one of my spike prime hub and have had to resort to using a second hub. I can control one hub from an Xbox controller but not both. How do I connect 1 xbox controller to 2 Spike hubs?
Beta Was this translation helpful? Give feedback.
All reactions