Skip to content

Turn off Interrupt Triggers and Pull Up Resistors on begin() #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 9, 2021
8 changes: 8 additions & 0 deletions Adafruit_MCP23017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ void Adafruit_MCP23017::begin(uint8_t addr, TwoWire *theWire) {
// all inputs on port A and B
writeRegister(MCP23017_IODIRA, 0xff);
writeRegister(MCP23017_IODIRB, 0xff);

// Turn off interrupt triggers
writeRegister(MCP23017_GPINTENA, 0x00);
writeRegister(MCP23017_GPINTENB, 0x00);

// Turn off pull up resistors
writeRegister(MCP23017_GPPUA, 0x00);
writeRegister(MCP23017_GPPUB, 0x00);
}

/**
Expand Down