My first post here on Arduino forums, sorry if I make any mistakes, hope to learn more from you all!
So I've recently purchased an AD5222 Dual channel 1M ohm digital potentiometer to use with my Arduino Uno. I only need to use one of the channels and so I've soldered and connected it accordingly.
I've been looking for examples with this chip however I've only found a more complex version of a digital potentiometer in the example sketches which makes use of SPI.
I was wondering if there's any other method to control the pot, other than using SPI.
Here is my simple coding to test the potentiometer:
int clk = 11;
int var = 13;
void setup() {
// put your setup code here, to run once:
pinMode(clk, OUTPUT);
pinMode(var, OUTPUT);
//analogWrite(clk,64);
digitalWrite(clk,0);
Serial.begin(9600);
}
void loop() {
for (int i = 0; i < 127; i++){
digitalWrite(var, 1);
digitalWrite(clk, 1);
delay(100);
digitalWrite(clk,0);
delay(100);
Serial.println(i);
}
Hi,
Good stuff, I glad you put together some code to test the AD5222, better than someone supplying code.
And you learn more about the AD5222 as you go.