Filter löschen
Filter löschen

Arduino read from sensor with I2C-Address 0x01

10 Ansichten (letzte 30 Tage)
Sebastian
Sebastian am 29 Jun. 2021
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

Antworten (0)

Kategorien

Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by