필터 지우기
필터 지우기

Use DS3502 digital potentiometer with Arduino support package

조회 수: 6 (최근 30일)
Lawrence Little
Lawrence Little 2023년 5월 23일
답변: Supraja 2023년 6월 2일
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.

답변 (1개)

Supraja
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

카테고리

Help CenterFile Exchange에서 I2C Devices에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by