필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Recording values from I2C sensors

조회 수: 1 (최근 30일)
Austin Pavlas
Austin Pavlas 2019년 3월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
I am wondering what the best way to go about recording values to matlab from various I2C sensors would be. I have working code for all of the the individual devices in the Arduino IDE, where I can open a terminal to read the values. Preferably I would like the have acess to all of these values in MATLAB. I am wondering if there is a way for MATLAB to read in the various values from the Terminal or would it be better to do all of the work in SIMULINK using the arduino toolbox.

답변 (1개)

Madhu Govindarajan
Madhu Govindarajan 2019년 3월 11일
If you use MATLAB Support Package for Arduino, there is readRegister function to read data in - https://www.mathworks.com/help/supportpkg/arduinoio/ref/readregister.html
The caveat here is you must know the right commands to write to the register so that you can put the sensor in default send data mode. You should be able to find this from the sensor spec sheet or existing Arduino code. If you need assistance with that, post the Arduino sketches here and some one should be able to assist you.
HTH,
Madhu

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by