-
|
When running the best_default_program in tank mode, we've found that tank mode works with the right motor being controlled with the right stick like intended, but the left motor is being controlled by the dpad, not the left stick. We've identified that the problem can be found in line 97, motor_left.throttle = map_range(gizmo.axes.left_y, 0, 255, -1.0, 1.0)We've found that this problem can be fixed by changing line 97 to look like this, motor_left.throttle = map_range(gizmo.axes.dpad_y, 0, 255, -1.0, 1.0)Changing self.left_x = data[0]
self.left_y = data[1]
self.right_x = data[2]
self.right_y = data[3]
self.dpad_x = data[4]
self.dpad_y = data[5]The data values 5 and 1 need to be switched to make the code work as intended as the data values currently are switched resulting in the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Please check whether the Mode light on your gamepad is on (just below the Logitech logo button, next to the button labeled "MODE"). The Mode button toggles swapping the Dpad and left joystick. When the green light is on, the two inputs will be swapped, so pressing the Dpad will show up as moving the left joystick, and vice-versa. You can verify this behavior by connecting your gamepad to a computer and going to https://hardwaretester.com/gamepad. The lines you've referenced in the CircuitPython library are correct as is. They must match the order the inputs are packed in the system processor firmware. That happens here: cstate.Axis0 = cstateJSON["AxisLX"];
cstate.Axis1 = cstateJSON["AxisLY"];
cstate.Axis2 = cstateJSON["AxisRX"];
cstate.Axis3 = cstateJSON["AxisRY"];
cstate.Axis4 = cstateJSON["AxisDX"];
cstate.Axis5 = cstateJSON["AxisDY"]; |
Beta Was this translation helpful? Give feedback.
Please check whether the Mode light on your gamepad is on (just below the Logitech logo button, next to the button labeled "MODE"). The Mode button toggles swapping the Dpad and left joystick. When the green light is on, the two inputs will be swapped, so pressing the Dpad will show up as moving the left joystick, and vice-versa. You can verify this behavior by connecting your gamepad to a computer and going to https://hardwaretester.com/gamepad.
The lines you've referenced in the CircuitPython library are correct as is. They must match the order the inputs are packed in the system processor firmware. That happens here:
gizmo.cpp line 607:
cstate.Axis0 = cstateJSON["AxisLX"]; cstate.A…