Use DS3502 digital potentiometer with Arduino support package
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Supraja
el 2 de Jun. de 2023
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 comentarios
Ver también
Categorías
Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!