diff --git a/Examples/ReadLoop/ReadLoop.ino b/Examples/ReadLoop/ReadLoop.ino index 47099e9..93e0a25 100644 --- a/Examples/ReadLoop/ReadLoop.ino +++ b/Examples/ReadLoop/ReadLoop.ino @@ -14,15 +14,17 @@ void setup() { while (!Serial) {} // wait for Serial comms to become ready Serial.println("Starting up"); Serial.println("Testing device connection..."); - Serial.println(myADC.testConnection() ? "MCP342X connection successful" : "MCP342X connection failed"); - + myADC.configure( MCP342X_MODE_CONTINUOUS | MCP342X_CHANNEL_1 | MCP342X_SIZE_16BIT | MCP342X_GAIN_1X ); - - Serial.println(myADC.getConfigRegShdw(), HEX); + + Serial.print("ConfigRegShdw: 0b"); + Serial.println(myADC.getConfigRegShdw(), BIN); // verify the settings + + Serial.println(myADC.testConnection() ? "MCP342X connection successful" : "MCP342X connection failed"); } // End of setup() diff --git a/MCP342X.cpp b/MCP342X.cpp index f0390f1..e84db8e 100644 --- a/MCP342X.cpp +++ b/MCP342X.cpp @@ -70,6 +70,7 @@ MCP342X::MCP342X(uint8_t address) { */ bool MCP342X::testConnection() { Wire.beginTransmission(devAddr); + Wire.write(configRegShdw | MCP342X_RDY); return (Wire.endTransmission() == 0); }