Skip to content

Commit 4d397d4

Browse files
committed
Added commented out board.stemma_i2c()
1 parent 36a27be commit 4d397d4

File tree

20 files changed

+52
-21
lines changed

20 files changed

+52
-21
lines changed

Macropad_2FA_TOTP/rtc_setter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import board
77
import adafruit_pcf8523
88

9-
pcf = adafruit_pcf8523.PCF8523(board.I2C())
9+
i2c = board.I2C() # uses board.SCL and board.SDA
10+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
11+
pcf = adafruit_pcf8523.PCF8523(i2c)
1012

1113
# values to set
1214
YEAR = 2021
@@ -36,4 +38,4 @@
3638
now.tm_hour,
3739
now.tm_min,
3840
now.tm_sec))
39-
time.sleep(1)
41+
time.sleep(1)

MagTag_Dishwasher_Status/wake_on_flip/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
epd = board.DISPLAY
1313

1414
# set up accelerometer
15-
lis = adafruit_lis3dh.LIS3DH_I2C(board.I2C(), address=0x19)
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+
lis = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19)
1618

1719
# See: ST Design Tip DT0008 - Simple screen rotation using
1820
# the accelerometer built-in 4D detection interrupt

Magic_Nine_Ball/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
i = random.randint(0, (len(images)-1)) # initial image is randomly selected
2424

2525
# Set up accelerometer on I2C bus, 4G range:
26-
ACCEL = adafruit_lis3dh.LIS3DH_I2C(board.I2C(), address=0x18)
26+
i2c = board.I2C() # uses board.SCL and board.SDA
27+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
28+
ACCEL = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x18)
2729

2830
ACCEL.range = adafruit_lis3dh.RANGE_4_G
2931

Matrix_Portal_CO2_Monitor/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
# ---------------------
1616

1717
# the sensor
18-
scd30 = adafruit_scd30.SCD30(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+
scd30 = adafruit_scd30.SCD30(i2c)
1921

2022
# optional if known (pick one)
2123
# scd30.ambient_pressure = 1013.25

Motion_Buddy/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
from adafruit_ble_apple_media import AppleMediaService, UnsupportedCommand
1818

1919
# Initialize the accelerometer
20-
i2c = board.I2C()
20+
i2c = board.I2C() # uses board.SCL and board.SDA
21+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
2122
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)
2223

2324
# Initialize BLE radio

Nunchuck_Laser/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
# STEMMA QT 3V needs to be activated
1818
i2c_power = digitalio.DigitalInOut(board.I2C_POWER)
1919
i2c_power.switch_to_output(value=False)
20-
i2c = board.I2C()
20+
i2c = board.I2C() # uses board.SCL and board.SDA
21+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
2122

2223
wing = adafruit_pca9685.PCA9685(i2c)
2324
wing.frequency = 50

Nunchuck_Ring/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import neopixel
99
import simpleio
1010

11-
nc = adafruit_nunchuk.Nunchuk(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+
nc = adafruit_nunchuk.Nunchuk(i2c)
1214
# create neopixel object
1315
NEOPIN = board.D6
1416
NEOLENGTH = 60

Ouija_Board_Bluefruit/code.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
num_motors = 1 # up to 4 motors depending on the prop you are driving
3232

33-
motorwing = MotorKit(i2c=board.I2C())
33+
i2c = board.I2C() # uses board.SCL and board.SDA
34+
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
35+
motorwing = MotorKit(i2c=i2c)
3436
motorwing.frequency = 122 # tune this 50 - 200 range
3537
max_throttle = 0.65 # tune this 0.2 - 1 range
3638

Pi400_Knobs/code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
sender = udp_client.SimpleUDPClient("127.0.0.1", 4560)
1515
sender.send_message("/trigger/prophet", [43, 110, 1, 0.7])
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
pcf = PCF.PCF8591(i2c)
1920

2021
pcf_in_0 = AnalogIn(pcf, PCF.A0)

PipBoy_2040/code.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
displayio.release_displays()
1212

13-
i2c_bus = board.I2C()
14-
ss = Seesaw(i2c_bus)
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)
1516

1617
spi = board.SPI() # setup for display over SPI
1718
tft_cs = board.D5

0 commit comments

Comments
 (0)