Newbee question (Xbox controller logic) #1748
Replies: 2 comments
-
|
These triggers each give a gradual value from 0 to 100. By doing (right - left), you get a result that ranges gradually between -100 for left fully pressed, to 0 for both released (or both pressed), to +100 for the right fully pressed. This gives a reasonably intuitive and convenient control with very few blocks, and lets you drive forward and in reverse at variable speed. There's nothing wrong with building your own logic with if / else blocks, though! If you want to share your end result, I'm sure there's people here who would love to learn from it :) |
Beta Was this translation helpful? Give feedback.
-
|
Thank you :-) I am just exploring. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am doing my first steps using pybricks, and I started with the preconfigured projects for the Lego sets.
Most of the blocks and code are easy to understand.
But I have one question regarding the Xbox controller usage.
In all examples (42109, 42124, 42129) the speed control is calculated by "right trigger" minus "left trigger".
What's the reason to use a mathematical subtraction in this case?
If I would have approached it myself, my first try would have been to simply check which button is pressed?
Beta Was this translation helpful? Give feedback.
All reactions