Skip to content

Commit b74d4ad

Browse files
authored
Merge pull request #2362 from adafruit/stemma_i2c-1
Added commented out board.stemma_i2c() - PR 1
2 parents f6188e7 + ec9caa6 commit b74d4ad

File tree

20 files changed

+51
-21
lines changed
  • Adafruit_Feather_ESP32-S2
  • Adafruit_Feather_Sense
  • Adafruit_Feather_TFT_ESP32-S2
  • Adafruit_IO_Power_Relay/code_light_sensor
  • Adafruit_NeoSlider/CircuitPython_Rainbow_Slider
  • Adafruit_Proximity_Trinkey
  • BLE_Gesture_Mouse
  • BLE_Heart_Rate_Trainer
  • BLE_Sensornet/feather_sense_sensornet
  • Burning_Fire_Wizard_Staff
  • CLUE_Egg_Drop
  • CLUE_Milk_Checker
  • CLUE_Servo_Barometer
  • CircuitPython_BLE_Darksaber
  • CircuitPython_Darksaber

20 files changed

+51
-21
lines changed

Adafruit_Feather_ESP32-S2/BME280_LC709203_Adafruit_IO/code.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
led.switch_to_output()
3535

3636
# Set up the BME280 and LC709203 sensors
37-
bme280 = adafruit_bme280.Adafruit_BME280_I2C(board.I2C())
38-
battery_monitor = LC709203F(board.I2C())
37+
i2c = board.I2C() # uses board.SCL and board.SDA
38+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
39+
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
40+
battery_monitor = LC709203F(i2c)
3941
battery_monitor.pack_size = battery_pack_size
4042

4143
# Collect the sensor data values and format the data

Adafruit_Feather_ESP32-S2/BME280_LC709203_Simple_Data/code.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
from adafruit_lc709203f import LC709203F, PackSize
1010

1111
# Create sensor objects, using the board's default I2C bus.
12-
i2c = board.I2C()
12+
i2c = board.I2C() # uses board.SCL and board.SDA
13+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1314
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
14-
battery_monitor = LC709203F(board.I2C())
15+
battery_monitor = LC709203F(i2c)
1516
battery_monitor.pack_size = PackSize.MAH400
1617

1718
# change this to match your location's pressure (hPa) at sea level

Adafruit_Feather_Sense/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import adafruit_lsm6ds.lsm6ds33
1515
import adafruit_sht31d
1616

17-
i2c = board.I2C()
17+
i2c = board.I2C() # uses board.SCL and board.SDA
18+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
1819

1920
apds9960 = adafruit_apds9960.apds9960.APDS9960(i2c)
2021
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)

Adafruit_Feather_TFT_ESP32-S2/LC709203_Adafruit_IO/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
led.switch_to_output()
3434

3535
# Set up the LC709203 sensor
36-
battery_monitor = LC709203F(board.I2C())
36+
i2c = board.I2C() # uses board.SCL and board.SDA
37+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
38+
battery_monitor = LC709203F(i2c)
3739
battery_monitor.pack_size = battery_pack_size
3840

3941
# Collect the sensor data values and format the data

Adafruit_Feather_TFT_ESP32-S2/LC709203_Simple_Data/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
from adafruit_lc709203f import LC709203F, PackSize
99

1010
# Create sensor object, using the board's default I2C bus.
11-
battery_monitor = LC709203F(board.I2C())
11+
i2c = board.I2C() # uses board.SCL and board.SDA
12+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
13+
battery_monitor = LC709203F(i2c)
1214

1315
# Update to match the mAh of your battery for more accurate readings.
1416
# Can be MAH100, MAH200, MAH400, MAH500, MAH1000, MAH2000, MAH3000.

Adafruit_Feather_TFT_ESP32-S2/TFT_simple_sensor_data/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
print("LC709203F test")
2222
print("Make sure LiPoly battery is plugged into the board!")
2323

24-
sensor = LC709203F(board.I2C())
24+
i2c = board.I2C() # uses board.SCL and board.SDA
25+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
26+
sensor = LC709203F(i2c)
2527

2628
print("IC version:", hex(sensor.ic_version))
2729

Adafruit_IO_Power_Relay/code_light_sensor/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
power_pin.switch_to_output()
6262

6363
# Set up the light sensor
64-
i2c = board.I2C()
64+
i2c = board.I2C() # uses board.SCL and board.SDA
65+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
6566
sensor = adafruit_bh1750.BH1750(i2c)
6667

6768
### Feeds ###

Adafruit_NeoSlider/CircuitPython_Rainbow_Slider/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
from adafruit_seesaw import neopixel
1111

1212
# NeoSlider Setup
13-
neoslider = Seesaw(board.I2C(), 0x30)
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+
neoslider = Seesaw(i2c, 0x30)
1416
potentiometer = AnalogInput(neoslider, 18)
1517
pixels = neopixel.NeoPixel(neoslider, 14, 4, pixel_order=neopixel.GRB)
1618

Adafruit_Proximity_Trinkey/NeoPixel_Brightness/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
import neopixel
1212
from adafruit_apds9960.apds9960 import APDS9960
1313

14-
apds = APDS9960(board.I2C())
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+
apds = APDS9960(i2c)
1517
pixels = neopixel.NeoPixel(board.NEOPIXEL, 2)
1618

1719
apds.enable_proximity = True

Adafruit_Proximity_Trinkey/Proximity_Spacebar_Game/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import neopixel
1515
from adafruit_apds9960.apds9960 import APDS9960
1616

17-
apds = APDS9960(board.I2C())
17+
i2c = board.I2C() # uses board.SCL and board.SDA
18+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
19+
apds = APDS9960(i2c)
1820
pixels = neopixel.NeoPixel(board.NEOPIXEL, 2)
1921
keyboard = Keyboard(usb_hid.devices)
2022

0 commit comments

Comments
 (0)