Update xsns_29_mcp230xx.ino

This commit is contained in:
andrethomas 2018-08-14 21:45:56 +02:00 committed by GitHub
parent 50f2eb3811
commit 1b714b0320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@
https://www.microchip.com/wwwproducts/en/MCP23017
I2C Address: 0x20 - 0x27
\*********************************************************************************************/
\*********************************************************************************************/
#define XSNS_29 29
@ -151,12 +151,12 @@ void MCP230xx_ApplySettings(void) {
void MCP230xx_Detect()
{
uint8_t buffer;
if (mcp230xx_type) {
return;
}
uint8_t buffer;
for (byte i = 0; i < sizeof(mcp230xx_addresses); i++) {
mcp230xx_address = mcp230xx_addresses[i];
I2cWrite8(mcp230xx_address, MCP230xx_IOCON, 0x80); // attempt to set bank mode - this will only work on MCP23017, so its the best way to detect the different chips 23008 vs 23017