Skip to content

Commit e89a0ee

Browse files
authored
Merge pull request #31 from adafruit/stemma_i2c
Added commented out board.STEMMA_I2C with explanation
2 parents 7ce6231 + 23cbb07 commit e89a0ee

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

examples/nunchuk_accel_mouse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import adafruit_nunchuk
88

99
m = Mouse(usb_hid.devices)
10-
nc = adafruit_nunchuk.Nunchuk(board.I2C())
10+
i2c = board.I2C() # uses board.SCL and board.SDA
11+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
12+
nc = adafruit_nunchuk.Nunchuk(i2c)
1113

1214
centerX = 120
1315
centerY = 110

examples/nunchuk_analog_mouse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import adafruit_nunchuk
88

99
m = Mouse(usb_hid.devices)
10-
nc = adafruit_nunchuk.Nunchuk(board.I2C())
10+
i2c = board.I2C() # uses board.SCL and board.SDA
11+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
12+
nc = adafruit_nunchuk.Nunchuk(i2c)
1113

1214
centerX = 128
1315
centerY = 128

examples/nunchuk_simpletest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import board
66
import adafruit_nunchuk
77

8-
nc = adafruit_nunchuk.Nunchuk(board.I2C())
8+
i2c = board.I2C() # uses board.SCL and board.SDA
9+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
10+
nc = adafruit_nunchuk.Nunchuk(i2c)
911

1012
while True:
1113
x, y = nc.joystick

0 commit comments

Comments
 (0)