필터 지우기
필터 지우기

How can i command an i2c digital potentiometer(DS1803) with Matlab Support Package for Arduino hardware ?

조회 수: 2 (최근 30일)
How can i command an i2c digital potentiometer(DS1803) with Matlab Support Package for Arduino hardware ?
Hello, I'm a french trainee and I'm working on temperature simulation thanks to digital potentiometer (DS 1803).
I command the potentiometer with an Arduino Mega, i succeeded with the arduino software but now I want to use Matlab.
I read instructions about the Matlab support package for arduino hardware, particulary i2c's instructions and i implemented these but there wasn't result..
Here is my code :
a=arduino('COM4','Mega2560');
dev=i2cdev(a,'0x28');
write(dev,'B10101001');
write(dev,100);
Can you help me ? regards.

답변 (2개)

Manish Annappa
Manish Annappa 2017년 10월 11일
1) Are you getting any error when you send the data to the device through i2cdev ? If so, post the error message here.
2) What is the expected behavior you see when you try to send the same data to the device outside of MATLAB (from Arduino software)?
  댓글 수: 1
Anthony Auvergnon
Anthony Auvergnon 2017년 10월 12일
Thanks for your answer, i adressed the issue yesterday, it was just an issue about how declare a binary number in matlab.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2017년 10월 12일
Replace
write(dev,'B10101001');
with
write(dev, uint8(bin2dec('10101001')) );

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by