bzerk / MCP4021_Digital_Potentiometer

Arduino library for Microchip 2-wire MCP4021 64 resistors (63 taps) digital potentiometer

Home Page:https://github.com/dzalf/MCP40xx_Digital_Potentiometer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MCP40xx_Digital_Potentiometer

Arduino/Teensy library for Microchip MCP4011/12/13/14 64 taps digital potentiometer

Library usage:

  1. Instantiate a new object as:

    MCP40xx digipot(CS Pin, UD Pin)

    1.1 An overloaded constructor is available. It makes possible to debug the code via a third element:

    MCP40xx digipot(CS Pin, UD Pin, true/false)

  2. Setup and begin the digital pot:

    digipot.setup() --> assigns and initialises the digital pins digipot.begin() --> sets the initial position of the wiper

    #TODO: set three possible states: minimum wiper (done!), 50% wiper or max wiper(done!)

  3. Increase/decrease the pot's value using the inc()/dec() methods.

  4. Methods for retrieving the approximate resistance value, tap position and increment/decrement times (in microseconds) are included.

Please read both .h and .cpp files as they are self-explanatory.

If you have any suggestions/pull requests please feel free to join me on the development.

Let's work together 😃

Happy tinkering 🍺

dzalf

About

Arduino library for Microchip 2-wire MCP4021 64 resistors (63 taps) digital potentiometer

https://github.com/dzalf/MCP40xx_Digital_Potentiometer


Languages

Language:C++ 100.0%