adds small correction to Super Nintendo USB controller guide

This commit is contained in:
Robert Dale Smith 2023-10-05 12:43:23 -05:00
parent f316859324
commit 95254871a5
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2023 Robert Dale Smith for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
# SPDX-License-Identifier: MIT
# USB HID descriptor for generic DirectInput compatible gamepad.
import usb_hid
@ -67,7 +68,7 @@ gamepad = usb_hid.Device(
usage_page=0x01, # Generic Desktop Control
usage=0x05, # Gamepad
report_ids=(0,), # Descriptor uses report ID 0.
in_report_lengths=(19,), # This gamepad sends 6 bytes in its report.
in_report_lengths=(19,), # This gamepad sends 19 bytes in its report.
out_report_lengths=(0,), # It does not receive any reports.
)

View file

@ -92,6 +92,11 @@ else:
report = bytearray(19)
report[2] = 0x08 # default released hat switch value
report[3] = 127 # default x center value
report[4] = 127 # default y center value
report[5] = 127 # default z center value
report[6] = 127 # default rz center value
prev_report = bytearray(report)
while True: