MCP41_Simple
Arduino Library for the MCP41 Series Of 8 Bit Digital Potentiometers
|
Simple Arduino Library for the MCP41 Series Of 8 Bit Digital Potentiometers (MCP41010, MCP41050, MCP41100)
The MCP41xxx series of digital Potentiometers have an 8 bit wiper and can be used as potentiometers, or as variable resistors (in the normal manner, that is, tie the Wiper output to the bottom leg).
They have about +/- 20% Tolerance
They are controlled via SPI, this makes it very easy to control them.
These devices are SPI based, and this library uses the hardware SPI class.
MCP41xx | Arduino |
---|---|
Pin 1 (CS) | Pin 10 or any other unused pin. |
Pin 2 (SCK) | SCK, Pin 13 on Uno/Pro-Mini/Nano, Pin 52 on Mega, otherwise this is often specifically marked. |
Pin 3 (SI) | MOSI, Pin 11 on Uno/Pro-Mini/Nano, Pin 51 on Mega, otherwise this is often specifically marked. |
Pin 4 (Vss) | Gnd |
Pin 8 (Vdd) | 5v (or 3v3) |
The remaining pins of the MCP41xxx (5, 6 and 7) are the potentiometer pins, which can largely be used like you would a potentiometer. Pins 5 and 7 are the "ends" and pin 6 is the wiper. If using as a "variable resistor" the datasheet recommends to tie wiper (6) to the B end (5). In general, the B end is best to ground if either of them will be I believe.
Upload the example to your Arduino and stand back in awe of the results.
Try the other examples for more excitement.
There really isn't anything to troubleshoot except your wiring, so, check your wiring.
I recommend to just look at the examples which show you how to use all the features, but if you want the nitty-gritty then here is the full class reference