Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Examples/ReadLoop/ReadLoop.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions MCP342X.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ MCP342X::MCP342X(uint8_t address) {
*/
bool MCP342X::testConnection() {
Wire.beginTransmission(devAddr);
Wire.write(configRegShdw | MCP342X_RDY);
return (Wire.endTransmission() == 0);
}

Expand Down