I tried to Init with the above I.E mcp0.Initialize & mcp1.Initialize. It still did not work.
But, after another 8 hours of, trying other libs, digging thru stuff, and then finally comparing it to Erel's example of wrapping a Library. I only had to change one line in rMCP4xxx.cpp and it works !!!
If I Initialize with mcp0.Initialize & mcp1.Initialize.
Old
namespace B4R {
void B4RMCPXXX::Initialize(Byte csPin,Pot pot,Resolution res,WiperConfiguration config) {
mcp = new (sizeMCP) MCP4XXX(csPin);
}
New
namespace B4R {
void B4RMCPXXX::Initialize(Byte csPin,Pot pot,Resolution res,WiperConfiguration config) {
mcp = new (sizeMCP) MCP4XXX(csPin, pot, res, config);
}
Thanks to everyone who offered suggestions, you got me on the right track to find the error and fix it! I ALMOST gave up. I have 5 chips (MCP4251 2 Digital Pots Each) I only needed 3 digital pots.
But, I like a challenge too !!!