How to access to i2c Qwiic connector on Arduino Uno R4Wifi?
I am using an Arduino UnoR4Wifi to read i2c accelerometer (LiS3DH) in Matlab and Simulink. This works ok using i2c Bus 0, with the accelerometer wires individually plugged into the board (A4,A5,3.3v,Gr). But I want to use the in-built ‘Qwiic’ connector on the Arduino board (aka ‘StemmaQT’ connector) for convenient plug-and-play access so I can quickly attach/detach sensors during an experiment.
However, when i attach the accelerometer to the Qwiic connector (Bus 1) it is not recognised by Matlab. I have tried using pull-down resistors attached to the SDA/SCL connections to activate Bus 1, to no avail. I am not sure if this is a Matlab software limitation, or an Arduino hardware limitation. Matlab suggests Bus 1 is not valid (see code below with no accelerometer attached), so i am guessing it might be a software limitation.
Any advice appreciated!
Raymond
>
> a = arduino(‘COM7’, ‘UnoR4WiFi’, ‘Libraries’, ‘I2C’);
>> scanI2CBus(a,0)
Device not detected on I2C Bus 0. Make sure the I2C device is properly connected to pins A4(SDA) and A5(SCL).
>> scanI2CBus(a,1)
Invalid I2C bus ID. Valid bus IDs are 0I am using an Arduino UnoR4Wifi to read i2c accelerometer (LiS3DH) in Matlab and Simulink. This works ok using i2c Bus 0, with the accelerometer wires individually plugged into the board (A4,A5,3.3v,Gr). But I want to use the in-built ‘Qwiic’ connector on the Arduino board (aka ‘StemmaQT’ connector) for convenient plug-and-play access so I can quickly attach/detach sensors during an experiment.
However, when i attach the accelerometer to the Qwiic connector (Bus 1) it is not recognised by Matlab. I have tried using pull-down resistors attached to the SDA/SCL connections to activate Bus 1, to no avail. I am not sure if this is a Matlab software limitation, or an Arduino hardware limitation. Matlab suggests Bus 1 is not valid (see code below with no accelerometer attached), so i am guessing it might be a software limitation.
Any advice appreciated!
Raymond
>
> a = arduino(‘COM7’, ‘UnoR4WiFi’, ‘Libraries’, ‘I2C’);
>> scanI2CBus(a,0)
Device not detected on I2C Bus 0. Make sure the I2C device is properly connected to pins A4(SDA) and A5(SCL).
>> scanI2CBus(a,1)
Invalid I2C bus ID. Valid bus IDs are 0 I am using an Arduino UnoR4Wifi to read i2c accelerometer (LiS3DH) in Matlab and Simulink. This works ok using i2c Bus 0, with the accelerometer wires individually plugged into the board (A4,A5,3.3v,Gr). But I want to use the in-built ‘Qwiic’ connector on the Arduino board (aka ‘StemmaQT’ connector) for convenient plug-and-play access so I can quickly attach/detach sensors during an experiment.
However, when i attach the accelerometer to the Qwiic connector (Bus 1) it is not recognised by Matlab. I have tried using pull-down resistors attached to the SDA/SCL connections to activate Bus 1, to no avail. I am not sure if this is a Matlab software limitation, or an Arduino hardware limitation. Matlab suggests Bus 1 is not valid (see code below with no accelerometer attached), so i am guessing it might be a software limitation.
Any advice appreciated!
Raymond
>
> a = arduino(‘COM7’, ‘UnoR4WiFi’, ‘Libraries’, ‘I2C’);
>> scanI2CBus(a,0)
Device not detected on I2C Bus 0. Make sure the I2C device is properly connected to pins A4(SDA) and A5(SCL).
>> scanI2CBus(a,1)
Invalid I2C bus ID. Valid bus IDs are 0 arduino, i2c, accelerometer, lis3dh, qwiic, stemmaqt MATLAB Answers — New Questions









