Help with Mega and MCP41010 Digital Potentiometer

Hi,

I have an Arduino Mega and MCP41010 Digital Potentiometer and it doesn't seem to be adjusting the resistance. Has anyone had luck with this combination as I can't get it to work. I used the 5 chips I've had and all don't work. The Mega board also seems to be working properly so all I can think that is causing the problem is the code.

Anyone have code that works? Or is there something in particular I need to add in the code?

Thanks
Henry

Or is there something in particular I need to add in the code?

Who can tell, you haven't posted it.

Are you using the correct pins for a mega? Ther are not the same as the UNO.

Or is there something in particular I need to add in the code?

Coding to the datasheet is all it takes to get them to work.

Hi!

I have the same problem.
Here is where i found the code i use:
http://blog.hekkers.net/2013/01/30/remotely-controllable-resistors/

I use the same code, and the wiring its exactly like the picture there.

I hope someone can help!

[and the wiring its exactly like the picture there.](http://and the wiring its exactly like the picture there.)
But that is not a Maga in the wiring and this post is about a Mega.

hello!
I have problem with mcp41010 too...

this is my code:

int digitalPotWrite(byte value)
{
int datapin = 10;
int CS = 9;
int SCK = 11;
digitalWrite(CS, LOW);
shiftOut(datapin, SCK, MSBFIRST, 17);
shiftOut(datapin, SCK, MSBFIRST, value);
digitalWrite(CS, HIGH);
}

void setup()
{
pinMode(DOUT, INPUT);
pinMode(PD_SCK, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(11, OUTPUT);
digitalWrite(9, HIGH);
Serial.begin(9600);
digitalPotWrite(10);
}
void loop()
{
....anything...

}

Arduino Pro Mini, wiring U can see in code

Looks like OK, but MCP41010 always on half position (128).
Do you have any idea why?