Skip to content

Commit d4ff038

Browse files
authored
Merge pull request #111 from adafruit/stemma_i2c
Added commented out board.STEMMA_I2C with explanation
2 parents 7b99130 + 9936ff9 commit d4ff038

16 files changed

+42
-17
lines changed

examples/seesaw_analogin_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
from adafruit_seesaw.seesaw import Seesaw
1111
from adafruit_seesaw.analoginput import AnalogInput
1212

13-
ss = Seesaw(board.I2C())
13+
i2c = board.I2C() # uses board.SCL and board.SDA
14+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
15+
ss = Seesaw(i2c)
1416

1517
analogin_pin = 2
1618
analog_in = AnalogInput(ss, analogin_pin)

examples/seesaw_arcade_qt_multi_board.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from adafruit_seesaw.digitalio import DigitalIO
88

99
# For most boards.
10-
i2c = 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
1112

1213
# For the QT Py RP2040, QT Py ESP32-S2, other boards that have SCL1/SDA1 as the STEMMA QT port.
1314
# import busio

examples/seesaw_arcade_qt_simpletest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
delay = 0.01
1313

1414
# For most boards.
15-
i2c = board.I2C()
15+
i2c = board.I2C() # uses board.SCL and board.SDA
16+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1617

1718
# For the QT Py RP2040, QT Py ESP32-S2, other boards that have SCL1/SDA1 as the STEMMA QT port.
1819
# import busio

examples/seesaw_attiny_simpletest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import board
88
from adafruit_seesaw.seesaw import Seesaw
99

10-
ss = Seesaw(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+
ss = Seesaw(i2c)
1113

1214
ss.pin_mode(5, ss.OUTPUT)
1315

examples/seesaw_crickit_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# from analogio import AnalogOut
1010
# import board
1111

12-
i2c_bus = board.I2C()
12+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
13+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1314
ss = Seesaw(i2c_bus)
1415
pwm1 = PWMOut(ss, 17)
1516
pwm2 = PWMOut(ss, 16)

examples/seesaw_digitalio_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
from adafruit_seesaw.seesaw import Seesaw
1616
from adafruit_seesaw.digitalio import DigitalIO
1717

18-
ss = Seesaw(board.I2C())
18+
i2c = board.I2C() # uses board.SCL and board.SDA
19+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
20+
ss = Seesaw(i2c)
1921

2022
button_pin = 2
2123
led_pin = 5

examples/seesaw_eeprom_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import board
1010
from adafruit_seesaw import seesaw
1111

12-
i2c_bus = board.I2C()
12+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
13+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1314
ss = seesaw.Seesaw(i2c_bus)
1415

1516
value = ss.eeprom_read8(0x02) # Read from address 2

examples/seesaw_joy_featherwing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
| (1 << BUTTON_SEL)
2222
)
2323

24-
i2c_bus = board.I2C()
24+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
25+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
2526

2627
ss = Seesaw(i2c_bus)
2728

examples/seesaw_minitft_featherwing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
| (1 << BUTTON_B)
2727
)
2828

29-
i2c_bus = board.I2C()
29+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
30+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
3031

3132
ss = Seesaw(i2c_bus, 0x5E)
3233

examples/seesaw_neopixel_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
from rainbowio import colorwheel
1616
from adafruit_seesaw import seesaw, neopixel
1717

18-
ss = seesaw.Seesaw(board.I2C())
18+
i2c = board.I2C() # uses board.SCL and board.SDA
19+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
20+
ss = seesaw.Seesaw(i2c)
1921

2022
NEOPIXEL_PIN = 19 # Can be any pin
2123
NEOPIXEL_NUM = 12 # No more than 60 pixels!

examples/seesaw_pwmout_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
import board
1616
from adafruit_seesaw import seesaw, pwmout
1717

18-
ss = seesaw.Seesaw(board.I2C())
18+
i2c = board.I2C() # uses board.SCL and board.SDA
19+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
20+
ss = seesaw.Seesaw(i2c)
1921

2022
PWM_PIN = 12 # If desired, change to any valid PWM output!
2123
led = pwmout.PWMOut(ss, PWM_PIN)

examples/seesaw_rotary_multiples.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
import board
88
from adafruit_seesaw import seesaw, rotaryio, digitalio, neopixel
99

10-
qt_enc1 = seesaw.Seesaw(board.I2C(), addr=0x36)
11-
qt_enc2 = seesaw.Seesaw(board.I2C(), addr=0x37)
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+
13+
qt_enc1 = seesaw.Seesaw(i2c, addr=0x36)
14+
qt_enc2 = seesaw.Seesaw(i2c, addr=0x37)
1215

1316
qt_enc1.pin_mode(24, qt_enc1.INPUT_PULLUP)
1417
button1 = digitalio.DigitalIO(qt_enc1, 24)

examples/seesaw_rotary_neopixel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# i2c = busio.I2C(board.SCL1, board.SDA1)
1313
# seesaw = seesaw.Seesaw(i2c, 0x36)
1414

15-
seesaw = seesaw.Seesaw(board.I2C(), 0x36)
15+
i2c = board.I2C() # uses board.SCL and board.SDA
16+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
17+
seesaw = seesaw.Seesaw(i2c, 0x36)
1618

1719
encoder = rotaryio.IncrementalEncoder(seesaw)
1820
seesaw.pin_mode(24, seesaw.INPUT_PULLUP)

examples/seesaw_rotary_simpletest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
# i2c = busio.I2C(board.SCL1, board.SDA1)
1212
# seesaw = seesaw.Seesaw(i2c, 0x36)
1313

14-
seesaw = seesaw.Seesaw(board.I2C(), addr=0x36)
14+
i2c = board.I2C() # uses board.SCL and board.SDA
15+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
16+
seesaw = seesaw.Seesaw(i2c, addr=0x36)
1517

1618
seesaw_product = (seesaw.get_version() >> 16) & 0xFFFF
1719
print("Found product {}".format(seesaw_product))

examples/seesaw_simpletest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
import board
1111
from adafruit_seesaw.seesaw import Seesaw
1212

13-
i2c_bus = board.I2C()
13+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
14+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1415

1516
ss = Seesaw(i2c_bus)
1617

examples/seesaw_soil_simpletest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from adafruit_seesaw.seesaw import Seesaw
99

10-
i2c_bus = board.I2C()
10+
i2c_bus = board.I2C() # uses board.SCL and board.SDA
11+
# i2c_bus = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1112

1213
ss = Seesaw(i2c_bus, addr=0x36)
1314

0 commit comments

Comments
 (0)