I am using a XIAO RP2350 to read a Grove - CO2 & Temperature & Humidity Sensor(SCD41) over I2C. This sensor works perfectly using the Wire but when I use the Wire1 it does not work. I have done the following changes in the file rp2040/hardware/rp2040/4.4.0/variants/seeed_xiao_rp2350.
The I2C scan code recognizes the sensor address using either Wire or Wire1. I am using the GPIO6(SDA) and GPIO7(SCK) for Wire and GPIO0(SDA) and GPIO1(SCK) for Wire1. Also, I tried another I2C sensor but the same behavior.
I am using this example sketch with following changes.
I am using a [XIAO RP2350](https://jp.seeedstudio.com/Seeed-XIAO-RP2350-p-5944.html) to read a[ Grove - CO2 & Temperature & Humidity Sensor(SCD41)](https://jp.seeedstudio.com/Grove-CO2-Temperature-Humidity-Sensor-SCD41-p-5025.html) over I2C. This sensor works perfectly using the **Wire** but when I use the **Wire1** it does not work. I have done the following changes in the file `rp2040/hardware/rp2040/4.4.0/variants/seeed_xiao_rp2350`.
```
// #define PIN_WIRE1_SDA (16u)
// #define PIN_WIRE1_SCL (17u)
#define PIN_WIRE1_SDA (0u)
#define PIN_WIRE1_SCL (1u)
```
The I2C scan code recognizes the sensor address using either **Wire** or **Wire1**. I am using the **GPIO6**(SDA) and **GPIO7**(SCK) for Wire and **GPIO0**(SDA) and **GPIO1(SCK)** for Wire1. Also, I tried another I2C sensor but the same behavior.
I am using this example [sketch](https://github.com/Sensirion/arduino-i2c-scd4x/blob/master/examples/exampleUsage/exampleUsage.ino) with following changes.
```
// Wire.begin();
// sensor.begin(Wire, SCD41_I2C_ADDR_62);
Wire1.begin();
sensor.begin(Wire1, SCD41_I2C_ADDR_62);
```
You don't need to change headers to redefine pins, there are calls your app can make to do that. See https://arduino-pico.readthedocs.io/en/latest/pins.html
Those are also illegal pins for i2c1 (Wire1), the hardware can only use certain pinouts See https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html for the allowed i2c1 pins
Actually, looking into the contributed Xaoi RP2350 pins_arduino.h, it's really messed up. They've redefined the Wire device (but not Wire1, so both Wire and Wire1 will try and use the same HW) and confused the wire0/1 pins.
The website shows
So no need to swap I2C devices at all. I will update #2811 to move Wire to the sda0/scl0 16/17, remove the swapping of i2c devices, and set Wire1 to sda1/scl1 on the 6/7 pinout.
Actually, looking into the contributed Xaoi RP2350 pins_arduino.h, it's really messed up. They've redefined the Wire device (but not Wire1, so both `Wire` and `Wire1` will try and use the same HW) and confused the wire0/1 pins.
The website shows


So no need to swap I2C devices at all. I will update #2811 to move `Wire` to the sda0/scl0 16/17, remove the swapping of i2c devices, and set `Wire1` to sda1/scl1 on the 6/7 pinout.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I am using a XIAO RP2350 to read a Grove - CO2 & Temperature & Humidity Sensor(SCD41) over I2C. This sensor works perfectly using the Wire but when I use the Wire1 it does not work. I have done the following changes in the file
rp2040/hardware/rp2040/4.4.0/variants/seeed_xiao_rp2350.The I2C scan code recognizes the sensor address using either Wire or Wire1. I am using the GPIO6(SDA) and GPIO7(SCK) for Wire and GPIO0(SDA) and GPIO1(SCK) for Wire1. Also, I tried another I2C sensor but the same behavior.
I am using this example sketch with following changes.
You don't need to change headers to redefine pins, there are calls your app can make to do that. See https://arduino-pico.readthedocs.io/en/latest/pins.html
Those are also illegal pins for i2c1 (Wire1), the hardware can only use certain pinouts See https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html for the allowed i2c1 pins
Actually, looking into the contributed Xaoi RP2350 pins_arduino.h, it's really messed up. They've redefined the Wire device (but not Wire1, so both
WireandWire1will try and use the same HW) and confused the wire0/1 pins.The website shows


So no need to swap I2C devices at all. I will update #2811 to move
Wireto the sda0/scl0 16/17, remove the swapping of i2c devices, and setWire1to sda1/scl1 on the 6/7 pinout.Thank you, @earlephilhower! Both Wire and Wire1 are working now!