Sample PyBricks blocks example driving Prime advanced driving base with xbox pad joystick #2088
-
|
Hi, Recently purchased Prime kit to begin STEM education with my young kids. We recently assembled the Prime advanced driving chassis that has a large blue wheel either side of hub to drive and steer, depending on wheel rotation. Most Pybricks - xbox controller block examples I've seen either use a motor for drive and another motor for steer with the xbox joystick. Other examples use the dpad for track-based vehicles. Would love some hints on how I could get the Prime advanced chassis working with Pybricks setup using the xbox pad joystick to control both wheel rotations/direction. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
|
Various combinations could work. Could you describe in words which inputs or joysticks you would find most intuitive to use? Then, combining that with the provided examples you've found, you could apply it to a drive base like this: If you try it, feel free to share your (partial) solution. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @laurensvalk thanks very much for swift response. Thanks to both your existing codes examples, and a recent discussion from @MrLuboG, have made a great start. If you see any optimizations, I'd welcome those. Loving Pybricks very much on day 1, thank you! |
Beta Was this translation helpful? Give feedback.
-
|
I believe I need the variable drive, as it acts like a toggle between driving functionality and using the front pickup tool or rear bumper tool on the chassis. Indeed I was getting very erratic toggling behavior with the drive mode, adding NOT pressed fixed that, thanks again! :) |
Beta Was this translation helpful? Give feedback.
-
|
Gave this a go as well. Here's some additional inspiration:
|
Beta Was this translation helpful? Give feedback.




Nice work!
In this variant, instead of having a separate task, it seems like you could simply replace
if drivewith simplyif xbox y is pressedto get the desired outcome.I don't think your separate task is having the intended effect. Currently, while Y is pressed, the drive variable is switched thousands of times per second. If you do keep it that way, you'd probably want to add a wait until not pressed after the switch.
Also, perhaps inside the switch on the left, you'd probably want to include blocks in either branch to stop the other motor.