Note: This can be used with any AVR/Arduino that needs to interface with hardware that is based on an MCP4017 Digital Pot/Rheostat (or most I2C DPs, IE AD5246 DP)
Driver to make usage of digital potentiometers like the MCP4017 easier, the creation of this class allow these methods to be passed on to child classes. (These types of digital potentiometers are very useful in analog front end gain and offset adjustment)
- Simple implementation with instancing (MCP4017 mcp4017(address, maxNumberofSteps, rangeinohms) for example)
- Feed it address, the numbers of steps in the digital potentiometer and the range of the DP in ohms
- The Addresses for the MCP4017 and AD5246 have been added to the header file for quick usage, other address can be used
- setSteps, sets the resistance based on an input number of steps to tune the wiper to
- setResistance, sets the number of steps to send based on a desired resistance input
- calcResistance calculates the resistance from the current wiper setting
SW_MCP4017 Library by Ryan Edwards, Sparky's Widgets is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.