diff --git a/FunHouse_IOT_Hub/battery_peripheral/code.py b/FunHouse_IOT_Hub/battery_peripheral/code.py index 72a526d31..4ef08284e 100644 --- a/FunHouse_IOT_Hub/battery_peripheral/code.py +++ b/FunHouse_IOT_Hub/battery_peripheral/code.py @@ -116,7 +116,9 @@ alarm_label = label.Label(terminalio.FONT, text="Voltage: ", color=0xFFFFFF, x=4 splash.append(alarm_label) -sensor = LC709203F(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +sensor = LC709203F(i2c) start = 0 while True: diff --git a/Glider_Paper_Airplane_Controller/code.py b/Glider_Paper_Airplane_Controller/code.py index d22d0e6ed..77a179104 100644 --- a/Glider_Paper_Airplane_Controller/code.py +++ b/Glider_Paper_Airplane_Controller/code.py @@ -13,7 +13,8 @@ from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode # I2C setup -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c) # range of LIS3DH diff --git a/Google_Sheet_Sensor_Logging/bme280_logger.py b/Google_Sheet_Sensor_Logging/bme280_logger.py index 2f9047ad9..69077c09b 100755 --- a/Google_Sheet_Sensor_Logging/bme280_logger.py +++ b/Google_Sheet_Sensor_Logging/bme280_logger.py @@ -17,7 +17,9 @@ UPDATE_RATE = 60 #--| User Config |----------------------------------------------- # Sensor setup -bme = adafruit_bme280.Adafruit_BME280_I2C(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +bme = adafruit_bme280.Adafruit_BME280_I2C(i2c) # Google Sheets API setup SCOPES = ['https://spreadsheets.google.com/feeds', diff --git a/HalloWing_Cat_Toy/code.py b/HalloWing_Cat_Toy/code.py index 7a91c7e91..1638505ed 100644 --- a/HalloWing_Cat_Toy/code.py +++ b/HalloWing_Cat_Toy/code.py @@ -54,7 +54,8 @@ pixels.fill((0, 0, 0)) pixels.show() # setup accelerometer -# i2c = board.I2C() +# i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c) diff --git a/Hallowing_Jump_Sound/jump-sound/code.py b/Hallowing_Jump_Sound/jump-sound/code.py index 5f4364f40..82cfa2f7b 100755 --- a/Hallowing_Jump_Sound/jump-sound/code.py +++ b/Hallowing_Jump_Sound/jump-sound/code.py @@ -71,16 +71,17 @@ TOUCH3 = touchio.TouchIn(board.TOUCH3) TOUCH4 = touchio.TouchIn(board.TOUCH4) # Set up accelerometer on I2C bus, 4G range: -I2C = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller if IS_HALLOWING_M4: import adafruit_msa301 - ACCEL = adafruit_msa301.MSA301(I2C) + ACCEL = adafruit_msa301.MSA301(i2c) else: import adafruit_lis3dh try: - ACCEL = adafruit_lis3dh.LIS3DH_I2C(I2C, address=0x18) # Production board + ACCEL = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x18) # Production board except ValueError: - ACCEL = adafruit_lis3dh.LIS3DH_I2C(I2C, address=0x19) # Beta hardware + ACCEL = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19) # Beta hardware ACCEL.range = adafruit_lis3dh.RANGE_4_G try: diff --git a/Hallowing_Jump_Sound/stomp-and-roar/code.py b/Hallowing_Jump_Sound/stomp-and-roar/code.py index dc2de1734..eee0b8745 100755 --- a/Hallowing_Jump_Sound/stomp-and-roar/code.py +++ b/Hallowing_Jump_Sound/stomp-and-roar/code.py @@ -54,16 +54,17 @@ except AttributeError: pass # Set up accelerometer on I2C bus, 4G range: -I2C = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller if IS_HALLOWING_M4: import adafruit_msa301 - ACCEL = adafruit_msa301.MSA301(I2C) + ACCEL = adafruit_msa301.MSA301(i2c) else: import adafruit_lis3dh try: - ACCEL = adafruit_lis3dh.LIS3DH_I2C(I2C, address=0x18) # Production board + ACCEL = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x18) # Production board except ValueError: - ACCEL = adafruit_lis3dh.LIS3DH_I2C(I2C, address=0x19) # Beta hardware + ACCEL = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19) # Beta hardware ACCEL.range = adafruit_lis3dh.RANGE_4_G STEP_INTERVAL_MIN = 0.3 # Shortest interval to walk one step (seconds) diff --git a/Home_Assistant_Sensor/code.py b/Home_Assistant_Sensor/code.py index 4365025a6..2cb55a42f 100755 --- a/Home_Assistant_Sensor/code.py +++ b/Home_Assistant_Sensor/code.py @@ -23,7 +23,9 @@ MQTT_TOPIC = "state/temp-sensor" USE_DEEP_SLEEP = True # Connect to the Sensor -sht = adafruit_shtc3.SHTC3(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +sht = adafruit_shtc3.SHTC3(i2c) # Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and # "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other diff --git a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_2x/code.py b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_2x/code.py index 17e870a17..f6db370ef 100755 --- a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_2x/code.py +++ b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_2x/code.py @@ -7,7 +7,8 @@ import board from adafruit_bme280 import basic as adafruit_bme280 # Get the board's default I2C port -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller #-------------------------------------------------------------------- # NOTE!!! This is the "special" part of the code diff --git a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_3x/code.py b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_3x/code.py index eeba454fb..25e26efb6 100755 --- a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_3x/code.py +++ b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_3x/code.py @@ -8,7 +8,8 @@ import adafruit_tca9548a from adafruit_bme280 import basic as adafruit_bme280 # Create I2C bus as normal -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # Create the TCA9548A object and give it the I2C bus tca = adafruit_tca9548a.TCA9548A(i2c) diff --git a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_4x/code.py b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_4x/code.py index 53024b8f7..e078c93f6 100755 --- a/I2C_Multiple_Same_Address/circuitpython/multi_bme280_4x/code.py +++ b/I2C_Multiple_Same_Address/circuitpython/multi_bme280_4x/code.py @@ -8,7 +8,8 @@ import adafruit_tca9548a from adafruit_bme280 import basic as adafruit_bme280 # Create I2C bus as normal -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # Create the TCA9548A object and give it the I2C bus tca = adafruit_tca9548a.TCA9548A(i2c) diff --git a/I2C_Multiple_Same_Address/circuitpython/multi_tca_2x/code.py b/I2C_Multiple_Same_Address/circuitpython/multi_tca_2x/code.py index a84fd1784..01d154812 100755 --- a/I2C_Multiple_Same_Address/circuitpython/multi_tca_2x/code.py +++ b/I2C_Multiple_Same_Address/circuitpython/multi_tca_2x/code.py @@ -8,7 +8,8 @@ import adafruit_tca9548a from adafruit_bme280 import basic as adafruit_bme280 # Create I2C bus as normal -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller #-------------------------------------------------------------------- # NOTE!!! This is the "special" part of the code diff --git a/I_Voted_Pin/code.py b/I_Voted_Pin/code.py index eca7f4af3..5c6f981d8 100755 --- a/I_Voted_Pin/code.py +++ b/I_Voted_Pin/code.py @@ -33,7 +33,8 @@ button_c = Debouncer(pin_c) #5 font = bitmap_font.load_font('/mround-31.bdf') # Set up display & add group -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller display_bus = displayio.I2CDisplay(i2c, device_address=0x3C) display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32) group = displayio.Group() diff --git a/LED_Bullwhip/code.py b/LED_Bullwhip/code.py index beae3c1ee..905e510bc 100644 --- a/LED_Bullwhip/code.py +++ b/LED_Bullwhip/code.py @@ -70,7 +70,8 @@ strip.show() WAVE_FILE = None -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller #Set up accelerometer & mic diff --git a/LED_Snowboard/code.py b/LED_Snowboard/code.py index c774343d0..2473806a9 100644 --- a/LED_Snowboard/code.py +++ b/LED_Snowboard/code.py @@ -67,7 +67,8 @@ enable.value = False # Set up accelerometer on I2C bus, 4G range: -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller accel = adafruit_lis3dh.LIS3DH_I2C(i2c) accel.range = adafruit_lis3dh.RANGE_4_G accel.set_tap(2, 15) diff --git a/Laser_Harp/code.py b/Laser_Harp/code.py index c8df580a2..9aed327c1 100644 --- a/Laser_Harp/code.py +++ b/Laser_Harp/code.py @@ -15,6 +15,7 @@ from adafruit_midi.control_change import ControlChange # Create I2C bus as normal i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # Create the TCA9548A object and give it the I2C bus tca = adafruit_tca9548a.TCA9548A(i2c) diff --git a/Laser_Harp/laser_harp_two_voice.py b/Laser_Harp/laser_harp_two_voice.py index dc366ed57..63d6afbb9 100644 --- a/Laser_Harp/laser_harp_two_voice.py +++ b/Laser_Harp/laser_harp_two_voice.py @@ -16,6 +16,7 @@ import adafruit_tca9548a # Create I2C bus as normal i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # Create the TCA9548A object and give it the I2C bus tca = adafruit_tca9548a.TCA9548A(i2c) diff --git a/Laser_Harp/usb_midi_code.py b/Laser_Harp/usb_midi_code.py index 75bfa60e1..6d8dd8233 100644 --- a/Laser_Harp/usb_midi_code.py +++ b/Laser_Harp/usb_midi_code.py @@ -14,6 +14,7 @@ from adafruit_midi.control_change import ControlChange # Create I2C bus as normal i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # Create the TCA9548A object and give it the I2C bus tca = adafruit_tca9548a.TCA9548A(i2c) diff --git a/MIDI_Melody_Maker/code.py b/MIDI_Melody_Maker/code.py index afd983e4d..69f8e9251 100644 --- a/MIDI_Melody_Maker/code.py +++ b/MIDI_Melody_Maker/code.py @@ -32,7 +32,8 @@ pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0) pixel.fill((0, 0, 0)) # Use for I2C for STEMMA OLED -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller display_bus = displayio.I2CDisplay(i2c, device_address=0x3D, reset=oled_reset) # STEMMA OLED dimensions. can have height of 64, but 32 makes text larger diff --git a/MIDI_to_CV_Skull/code.py b/MIDI_to_CV_Skull/code.py index e6257c2a2..7149cfef4 100644 --- a/MIDI_to_CV_Skull/code.py +++ b/MIDI_to_CV_Skull/code.py @@ -25,7 +25,8 @@ gate = DigitalInOut(board.A1) gate.direction = Direction.OUTPUT # i2c setup -i2c = board.I2C() +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller # dac setup over i2c dac = adafruit_mcp4725.MCP4725(i2c) diff --git a/Macropad_2FA_TOTP/code.py b/Macropad_2FA_TOTP/code.py index 734d2173f..834f25089 100755 --- a/Macropad_2FA_TOTP/code.py +++ b/Macropad_2FA_TOTP/code.py @@ -43,7 +43,9 @@ except KeyError: raise # set board to use PCF8523 as its RTC -pcf = adafruit_pcf8523.PCF8523(board.I2C()) +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller +pcf = adafruit_pcf8523.PCF8523(i2c) rtc.set_time_source(pcf) #-------------------------------------------------------------------------