Skip to content

Commit e793266

Browse files
authored
Merge pull request #3197 from jedgarpark/xac-joystick
reduced lag in joystick code
2 parents 4aa19e0 + 6e330a3 commit e793266

File tree

1 file changed

+5
-5
lines changed
  • TRRS_Trinkey_Demos/XAC_Joystick

1 file changed

+5
-5
lines changed

TRRS_Trinkey_Demos/XAC_Joystick/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ def range_map(value, in_min, in_max, out_min, out_max):
8282
newY = int(yAvg.average())
8383

8484
#We only call move_joysticks if one of the values has changed from last time
85-
if (newX != lastXAvg or newY != lastYAvg):
86-
gp.move_joysticks(x=newX,y=newY)
87-
# print(hor.value, vert.value) # print debug raw values
88-
# print((newX, newY,)) # print debug remapped, averaged values
85+
#if (newX != lastXAvg or newY != lastYAvg):
86+
gp.move_joysticks(x=newX,y=newY)
87+
# print(hor.value, vert.value) # print debug raw values
88+
# print((newX, newY,)) # print debug remapped, averaged values
8989
#Sleep to avoid overwhelming the XAC
90-
time.sleep(0.05)
90+
time.sleep(0.008) # 125Hz polling rate is standard

0 commit comments

Comments
 (0)