Arduino read from sensor with I2C-Address 0x01
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Arduino Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!