Skip to content

Commit

Permalink
Merge pull request #51 from kappaj/kappaj-int8-fix
Browse files Browse the repository at this point in the history
Fix state value conversion for joystick (LX, LY, RX, RY) to make it int8 compatible
  • Loading branch information
flok authored Dec 3, 2023
2 parents b67bcb2 + f193fad commit fc60c0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pydualsense/pydualsense.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ def readInput(self, inReport) -> None:

self.states = states
# states 0 is always 1
self.state.LX = states[1] - 127
self.state.LY = states[2] - 127
self.state.RX = states[3] - 127
self.state.RY = states[4] - 127
self.state.LX = states[1] - 128
self.state.LY = states[2] - 128
self.state.RX = states[3] - 128
self.state.RY = states[4] - 128
self.state.L2 = states[5]
self.state.R2 = states[6]

Expand Down Expand Up @@ -862,4 +862,4 @@ class DSBattery:
"""
def __init__(self) -> None:
self.State = BatteryState.POWER_SUPPLY_STATUS_UNKNOWN
self.Level = 0
self.Level = 0

0 comments on commit fc60c0f

Please sign in to comment.