Skip to content

Commit 59c3465

Browse files
authored
Merge pull request #76 from FoamyGuy/rename_gamepad_example
fix gamepad examples
2 parents d5b6ea5 + 2d056b0 commit 59c3465

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed
File renamed without changes.

examples/hid_joywing_gamepad.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55
# https://www.adafruit.com/product/3632
66
# https://learn.adafruit.com/joy-featherwing
77

8+
# You must add a gamepad HID device inside your boot.py file
9+
# in order to use this example.
10+
# See this Learn Guide for details:
11+
# https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/hid-devices#custom-hid-devices-3096614-9
12+
813
import time
914

1015
import board
1116
import busio
1217
from micropython import const
13-
import adafruit_seesaw
18+
from adafruit_seesaw.seesaw import Seesaw
1419
import usb_hid
15-
from gamepad import Gamepad
20+
from hid_gamepad import Gamepad
1621

1722

1823
def range_map(value, in_min, in_max, out_min, out_max):
@@ -34,7 +39,7 @@ def range_map(value, in_min, in_max, out_min, out_max):
3439

3540
i2c = busio.I2C(board.SCL, board.SDA)
3641

37-
ss = adafruit_seesaw.Seesaw(i2c)
42+
ss = Seesaw(i2c)
3843

3944
ss.pin_mode_bulk(button_mask, ss.INPUT_PULLUP)
4045

examples/hid_simple_gamepad.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
22
# SPDX-License-Identifier: MIT
33

4+
# You must add a gamepad HID device inside your boot.py file
5+
# in order to use this example.
6+
# See this Learn Guide for details:
7+
# https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/hid-devices#custom-hid-devices-3096614-9
8+
49
import board
510
import digitalio
611
import analogio
712
import usb_hid
813

9-
from gamepad import Gamepad
14+
from hid_gamepad import Gamepad
1015

1116
gp = Gamepad(usb_hid.devices)
1217

0 commit comments

Comments
 (0)