Borrar filtros
Borrar filtros

Arduino i2c address not getting identified.

3 visualizaciones (últimos 30 días)
Sourabh Karmakar
Sourabh Karmakar el 26 de Jul. de 2022
Respondida: Mirko Krah el 4 de Ag. de 2023
Hi,
I am using Arduino Due for my project in Matlab 2022a on windows 11. I am using the Arduino engineering kit latest update also. I am getting the following error:
>> a = arduino('COM5', 'Due'),
a =
arduino with properties:
Port: 'COM5'
Board: 'Due'
AvailablePins: {'D2-D53', 'A0-A11'}
AvailableDigitalPins: {'D2-D53', 'A0-A11'}
AvailablePWMPins: {'D2-D13'}
AvailableAnalogPins: {'A0-A11'}
AvailableI2CBusIDs: [0, 1]
AvailableSerialPortIDs: [1, 2, 3]
Libraries: {'I2C'}
Show all properties
>> x = scanI2CBus(a,1)
x =
2×1 cell array
{'0x48'}
{'0x49'}
>> deviceObj = device(a,'I2CAddress','0x49')
Invalid I2C device address '0x49'. Use scanI2CBus for a list of devices detected on an I2C bus.
>> deviceObj = device(a,'I2CAddress',0x49)
Invalid I2C device address '0x49'. Use scanI2CBus for a list of devices detected on an I2C bus.
I am not able to figure out what I am doing wrong in the deviceObj creation.
I appreciate any suggestion for a solution.

Respuestas (1)

Mirko Krah
Mirko Krah el 4 de Ag. de 2023
Hey,
the Due has two I2C Busses.
Can you try this:
deviceObj = device(a,'I2CAddress','0x49','Bus',1);
If you are on Bus "0", try ist with this:
deviceObj = device(a,'I2CAddress','0x49','Bus',1);

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by