Skip to content

Commit 9525487

Browse files
adds small correction to Super Nintendo USB controller guide
1 parent f316859 commit 9525487

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Super_Nintendo_USB_Controller/boot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-FileCopyrightText: 2023 Robert Dale Smith for Adafruit Industries
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
4+
# USB HID descriptor for generic DirectInput compatible gamepad.
45

56
import usb_hid
67

@@ -67,7 +68,7 @@
6768
usage_page=0x01, # Generic Desktop Control
6869
usage=0x05, # Gamepad
6970
report_ids=(0,), # Descriptor uses report ID 0.
70-
in_report_lengths=(19,), # This gamepad sends 6 bytes in its report.
71+
in_report_lengths=(19,), # This gamepad sends 19 bytes in its report.
7172
out_report_lengths=(0,), # It does not receive any reports.
7273
)
7374

Super_Nintendo_USB_Controller/code.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ def read_snes_controller():
9292

9393
report = bytearray(19)
9494
report[2] = 0x08 # default released hat switch value
95+
report[3] = 127 # default x center value
96+
report[4] = 127 # default y center value
97+
report[5] = 127 # default z center value
98+
report[6] = 127 # default rz center value
99+
95100
prev_report = bytearray(report)
96101

97102
while True:

0 commit comments

Comments
 (0)