Arduino read from sensor with I2C-Address 0x01

16 次查看(过去 30 天)
Hi,
I have an I2C-Sensor, which has the address 0x01. That's obviously against the standard, but I can't do anything about it. The sensor is connected to an Arduino Mega2560. The wiring is fine, because I can get data from the sensor if I upload a sketch to the Arduino.
However, I don't get data from the sensor using the MATLAB® Support Package for Arduino®. It seems to me, that the Support Package doesn't support the sensor's address. The scanI2CBus function does not find the address, probably because it starts searching from address 8:
a = arduino('COM4', 'Mega2560', 'TraceOn', true)
addrs = scanI2CBus(a)
Output:
Arduino::Wire.begin();
Arduino::Wire.beginTransmission(8);
Arduino::Wire.endTransmission(1); --> 2
Arduino::Wire.beginTransmission(9);
Arduino::Wire.endTransmission(1); --> 2
.
.
.
Arduino::Wire.beginTransmission(119);
Arduino::Wire.endTransmission(1); --> 2
Device not detected on I2C Bus 0.
Make sure the I2C device is
properly connected to pins D20(SDA)
and D21(SCL).
Selecting 0x01 manually via
pI2CObj = device(a, 'I2CAddress', '0x01')
also fails. I would be very happy, if anyone could point me in the right direction or can provide a solution.
Thanks,
Sebastian

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for Arduino Hardware 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by