How to use/install Mcp4261.h and "Spi.h" by dreamcat and CM Thompson for MCP4261

Good day,

Just want to ask how to install/use the "Spi.h" and MCP4261 digital potentiometer library posted on Github by dreamcat?

Thanks and Best Regards,
Leo

lpestanas:
Good day,

Just want to ask how to install/use the "Spi.h" and MCP4261 digital potentiometer library posted on Github by dreamcat?

https://github.com/dreamcat4/Mcp4261

Just had only a cursory look at that repository and noticed a couple of things:

  • the author mentioned that it is supposed to work on ATmega328P while the Yun has, like the Leonardo, a 32U4 chip instead. Should be compatible, but there might be slight differences in the pins.
  • the page linked to also states that you need to use a 3rd party SPI library, but the link goes to the default SPI librariy at arduino.cc

Ralf

Hi Sir,

When I try to install these libraries, I got a lot of compilation errors like:

extern SPI Spi : does not name a type.
W.program no such directory (I changed to "Arduino.h", error resolved).

I just want to read the potentiometer register and display it on the Serial Monitor.
And from there I will increment/decrement its value and display using SPI as the communication to the device.

I am able to write using SPI but to readback the value written is what I want.
I just have a try on these libraries. Is there a basic way to store the read value of the current setting of this MCP4261 and display it on the Serial Monitor?

Thanks and Best Regards,
Leo