Use DS3502 digital potentiometer with Arduino support package
4 ビュー (過去 30 日間)
古いコメントを表示
I am trying to use a Adafruit DS3502 I2C Digital Potentiometer with the Matlab Arduino support package. I already connected the arduino to the computer and the digital pot to the arduino. I have loaded the arduino and the digital pot device via
ard = arduino;
COM = string(ard.Port);
Board = string(ard.Board);
clear ard
a = arduino(COM,Board,'Libraries','I2C');%load Arduino board
addrs = scanI2CBus(a);
%
ds3502 = device(a,'I2CAddress',0x28);
My question is how do I write to the device? The digital pot has a 127 different resistance values.
0 件のコメント
回答 (1 件)
Supraja
2023 年 6 月 2 日
You can use the writeDigitalPin function to write into the device of the Arduino. The syntax of the function is: writeDigitalPin(a,pin,value)
This writes the specified value to the specified pin on the Arduino hardware in the connection a
You can follow the link here for further reference:https://www.mathworks.com/help/supportpkg/arduinoio/ref/writedigitalpin.html
0 件のコメント
参考
カテゴリ
Help Center および File 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!