Go Down

Topic: Include 2 libraries in matlab (Read 1 time) previous topic - next topic

Nejcar

Hello I am working on a project and I need to include SPI library and I2C library. is there any way I can include both? Thank you

PaulS

In Matlab? No. They are Arduino libraries!
The art of getting good answers lies in asking good questions.

Nejcar

Code: [Select]


a = arduino('com22', 'uno', 'Libraries', 'SPI');


This is the syntax for spi and
Code: [Select]


a = arduino('com22', 'uno', 'Libraries', 'I2C');




But i want them together, on one arduino is it possible?
Thank you

PaulS

That is invoking a matlab library. It has nothing to do with the SPI or I2C libraries on the Arduino. Those statements have NOTHING to do with what is on the Arduino.

You need to ask on a MatLab forum.
The art of getting good answers lies in asking good questions.

Robin2

It seems to me rather unlikely that Matlab would use either of those libraries because both of them depend on access to hardware that exists on an Arduino but not on a PC.

Assuming you have an Arduino program that you want to work in conjunction with Matlab on your PC then please post the Arduino code so we can understand your problem. And please post your program using the code button </>
Code: [Select]
so it looks like this

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Nejcar

This works, for those who will have same problem :)
Code: [Select]
a = arduino(com, 'due', 'Libraries', {'I2C','SPI'});

Go Up