diff --git a/joydance/__init__.py b/joydance/__init__.py index 4c54945..f42ef29 100644 --- a/joydance/__init__.py +++ b/joydance/__init__.py @@ -293,11 +293,11 @@ async def collect_accelerometer_data(self): # Accelerator axes on phone & Joy-Con are different so we need to swap some axes # https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/imu_sensor_notes.md - accel = accels[2] - x = accel[1] * -1 - y = accel[0] - z = accel[2] - self.accel_data.append([x, y, z]) + for accel in accels: + x = accel[1] * -1 + y = accel[0] + z = accel[2] + self.accel_data.append([x, y, z]) except OSError: self.disconnect() return diff --git a/joydance/constants.py b/joydance/constants.py index 1ef7e1f..1c24133 100644 --- a/joydance/constants.py +++ b/joydance/constants.py @@ -14,10 +14,10 @@ class WsSubprotocolVersion(Enum): WS_SUBPROTOCOLS[WsSubprotocolVersion.V1.value] = 'v1.phonescoring.jd.ubisoft.com' WS_SUBPROTOCOLS[WsSubprotocolVersion.V2.value] = 'v2.phonescoring.jd.ubisoft.com' -FRAME_DURATION = 1 / 60 -SEND_FREQ_MS = 0.005 -ACCEL_ACQUISITION_FREQ_HZ = 60 # Hz -ACCEL_ACQUISITION_LATENCY = 40 # ms +FRAME_DURATION = 0.015 +SEND_FREQ_MS = 0.05 +ACCEL_ACQUISITION_FREQ_HZ = 200 # Hz +ACCEL_ACQUISITION_LATENCY = 0 # ms ACCEL_MAX_RANGE = 8 # ±G DEFAULT_CONFIG = {