Skip to content
Discussion options

You must be logged in to vote

Just in case - here's another example if you actually want all of the axes to report over USB-HID. Using this code, the coarse axis reports as X at full scale, the fine axis reports as Y at full scale, and the combined coarse+fine axis reports as Z.

"""Another JoystickXL compound axis example where all axes report over USB-HID."""

import board
from joystick_xl.inputs import Axis, VirtualInput
from joystick_xl.joystick import Joystick

joystick = Joystick()

joystick.add_input(
    Axis(source=board.A1),  # x-axis (coarse)
    Axis(source=board.A0),  # y-axis (fine)
    Axis(source=VirtualInput(value=0)),  # z-axis (compound 0.75x + 0.25y)
)

while True:
    joystick.axis[Axis.Z].source_v…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@MikeFindlay
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MikeFindlay
Comment options

Answer selected by MikeFindlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants