Skip to content

Commit

Permalink
Merge pull request #1 from zero-ones-given/two-stick-drive
Browse files Browse the repository at this point in the history
Select the highest value axis instead of highest value stick
  • Loading branch information
TuureKaunisto authored May 8, 2024
2 parents 2127b40 + 26c0bc3 commit 0fe26c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main/sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,11 @@ void loop() {
float rightThumbY = myGamepad->axisRY();
float x = rightThumbX;
float y = rightThumbY;
if (fabs(leftThumbX) + fabs(leftThumbY) > fabs(rightThumbX) + fabs(rightThumbY)) {

if (fabs(leftThumbX) > fabs(rightThumbX)) {
x = leftThumbX;
}
if (fabs(leftThumbY) > fabs(rightThumbY)) {
y = leftThumbY;
}

Expand Down

0 comments on commit 0fe26c0

Please sign in to comment.