{"id":814,"date":"2020-10-30T20:56:26","date_gmt":"2020-10-30T13:56:26","guid":{"rendered":"https:\/\/www.makeriot2020.com\/?p=814"},"modified":"2022-05-28T15:08:34","modified_gmt":"2022-05-28T08:08:34","slug":"mcp23017-with-adafruit-library","status":"publish","type":"post","link":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/","title":{"rendered":"MCP23017 with Adafruit Library"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In a previous <a href=\"http:\/\/makeriot2020.com\/index.php\/2020\/10\/13\/using-the-mcp23017-to-increase-your-gpios\/\" target=\"_blank\" rel=\"noreferrer noopener\">post<\/a>, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,<br>I will have a quick look at using Adafruit&#8217;s library for this IC. I believe that this library brings a lot of ease-of-use to the part, making it possible to obscure some of the complexity of I2C.<br><br>I do however prefer to use the native Wire library myself, as it is slightly faster.<br><br>You can download the <a data-type=\"URL\" data-id=\"https:\/\/github.com\/adafruit\/Adafruit-MCP23017-Arduino-Library\" href=\"https:\/\/github.com\/adafruit\/Adafruit-MCP23017-Arduino-Library\" target=\"_blank\" rel=\"noreferrer noopener\">Adafruit MCP23017 Library from here<\/a>..<br><br><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Pin Addressing<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">When using single pin operations such as&nbsp;<em>pinMode(pinId, dir)<\/em>&nbsp;or&nbsp;<em>digitalRead(pinId)<\/em>&nbsp;or&nbsp;<em>digitalWrite(pinId, val)<\/em>&nbsp;then the pins are addressed using the ID&#8217;s below. For example, for set the mode of&nbsp;<em>GPB0<\/em>&nbsp;then use&nbsp;<em>pinMode(8, &#8230;)<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Physical Pin #<\/th><th>Pin Name<\/th><th>Pin ID<\/th><\/tr><\/thead><tbody><tr><td>21<\/td><td>GPA0<\/td><td>0<\/td><\/tr><tr><td>22<\/td><td>GPA1<\/td><td>1<\/td><\/tr><tr><td>23<\/td><td>GPA2<\/td><td>2<\/td><\/tr><tr><td>24<\/td><td>GPA3<\/td><td>3<\/td><\/tr><tr><td>25<\/td><td>GPA4<\/td><td>4<\/td><\/tr><tr><td>26<\/td><td>GPA5<\/td><td>5<\/td><\/tr><tr><td>27<\/td><td>GPA6<\/td><td>6<\/td><\/tr><tr><td>28<\/td><td>GPA7<\/td><td>7<\/td><\/tr><tr><td>1<\/td><td>GPB0<\/td><td>8<\/td><\/tr><tr><td>2<\/td><td>GPB1<\/td><td>9<\/td><\/tr><tr><td>3<\/td><td>GPB2<\/td><td>10<\/td><\/tr><tr><td>4<\/td><td>GPB3<\/td><td>11<\/td><\/tr><tr><td>5<\/td><td>GPB4<\/td><td>12<\/td><\/tr><tr><td>6<\/td><td>GPB5<\/td><td>13<\/td><\/tr><tr><td>7<\/td><td>GPB6<\/td><td>14<\/td><\/tr><tr><td>8<\/td><td>GPB7<\/td><td>15<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Some examples<\/strong>, directly from the library, all code belongs to Adafruit, and was not written by me.<br><br>1. A Button Example<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>#include &lt;Wire.h&gt;\n#include \"Adafruit_MCP23017.h\"\n\n\/\/ Basic pin reading and pullup test for the MCP23017 I\/O expander\n\/\/ public domain!\n\n\/\/ Connect pin #12 of the expander to Analog 5 (i2c clock)\n\/\/ Connect pin #13 of the expander to Analog 4 (i2c data)\n\/\/ Connect pins #15, 16 and 17 of the expander to ground (address selection)\n\/\/ Connect pin #9 of the expander to 5V (power)\n\/\/ Connect pin #10 of the expander to ground (common ground)\n\/\/ Connect pin #18 through a ~10kohm resistor to 5V (reset pin, active low)\n\n\/\/ Input #0 is on pin 21 so connect a button or switch from there to ground\n\nAdafruit_MCP23017 mcp;\n  \nvoid setup() {  \n  mcp.begin();      \/\/ use default address 0\n\n  mcp.pinMode(0, INPUT);\n  mcp.pullUp(0, HIGH);  \/\/ turn on a 100K pullup internally\n\n  pinMode(13, OUTPUT);  \/\/ use the p13 LED as debugging\n}\n\n\n\nvoid loop() {\n  \/\/ The LED will 'echo' the button\n  digitalWrite(13, mcp.digitalRead(0));\n}<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">2. An Interrupt Example<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>\/\/ Install the LowPower library for optional sleeping support.\n\/\/ See loop() function comments for details on usage.\n\/\/#include &lt;LowPower.h&gt;\n\n#include &lt;Wire.h&gt;\n#include &lt;Adafruit_MCP23017.h&gt;\n\nAdafruit_MCP23017 mcp;\n\nbyte ledPin=13;\n\n\/\/ Interrupts from the MCP will be handled by this PIN\nbyte arduinoIntPin=3;\n\n\/\/ ... and this interrupt vector\nbyte arduinoInterrupt=1;\n\nvolatile boolean awakenByInterrupt = false;\n\n\/\/ Two pins at the MCP (Ports A\/B where some buttons have been setup.)\n\/\/ Buttons connect the pin to grond, and pins are pulled up.\nbyte mcpPinA=7;\nbyte mcpPinB=15;\n\nvoid setup(){\n\n  Serial.begin(9600);\n  Serial.println(\"MCP23007 Interrupt Test\");\n\n  pinMode(arduinoIntPin,INPUT);\n\n  mcp.begin();      \/\/ use default address 0\n  \n  \/\/ We mirror INTA and INTB, so that only one line is required between MCP and Arduino for int reporting\n  \/\/ The INTA\/B will not be Floating \n  \/\/ INTs will be signaled with a LOW\n  mcp.setupInterrupts(true,false,LOW);\n\n  \/\/ configuration for a button on port A\n  \/\/ interrupt will triger when the pin is taken to ground by a pushbutton\n  mcp.pinMode(mcpPinA, INPUT);\n  mcp.pullUp(mcpPinA, HIGH);  \/\/ turn on a 100K pullup internally\n  mcp.setupInterruptPin(mcpPinA,FALLING); \n\n  \/\/ similar, but on port B.\n  mcp.pinMode(mcpPinB, INPUT);\n  mcp.pullUp(mcpPinB, HIGH);  \/\/ turn on a 100K pullup internall\n  mcp.setupInterruptPin(mcpPinB,FALLING);\n\n  \/\/ We will setup a pin for flashing from the int routine\n  pinMode(ledPin, OUTPUT);  \/\/ use the p13 LED as debugging\n  \n}\n\n\/\/ The int handler will just signal that the int has happen\n\/\/ we will do the work from the main loop.\nvoid intCallBack(){\n  awakenByInterrupt=true;\n}\n\nvoid handleInterrupt(){\n  \n  \/\/ Get more information from the MCP from the INT\n  uint8_t pin=mcp.getLastInterruptPin();\n  uint8_t val=mcp.getLastInterruptPinValue();\n  \n  \/\/ We will flash the led 1 or 2 times depending on the PIN that triggered the Interrupt\n  \/\/ 3 and 4 flases are supposed to be impossible conditions... just for debugging.\n  uint8_t flashes=4; \n  if(pin==mcpPinA) flashes=1;\n  if(pin==mcpPinB) flashes=2;\n  if(val!=LOW) flashes=3;\n\n  \/\/ simulate some output associated to this\n  for(int i=0;i&lt;flashes;i++){  \n    delay(100);\n    digitalWrite(ledPin,HIGH);\n    delay(100);\n    digitalWrite(ledPin,LOW);\n  }\n\n  \/\/ we have to wait for the interrupt condition to finish\n  \/\/ otherwise we might go to sleep with an ongoing condition and never wake up again.\n  \/\/ as, an action is required to clear the INT flag, and allow it to trigger again.\n  \/\/ see datasheet for datails.\n  while( ! (mcp.digitalRead(mcpPinB) &amp;&amp; mcp.digitalRead(mcpPinA) ));\n  \/\/ and clean queued INT signal\n  cleanInterrupts();\n}\n\n\/\/ handy for interrupts triggered by buttons\n\/\/ normally signal a few due to bouncing issues\nvoid cleanInterrupts(){\n  EIFR=0x01;\n  awakenByInterrupt=false;\n}  \n\n\/**\n * main routine: sleep the arduino, and wake up on Interrups.\n * the LowPower library, or similar is required for sleeping, but sleep is simulated here.\n * It is actually posible to get the MCP to draw only 1uA while in standby as the datasheet claims,\n * however there is no stadndby mode. Its all down to seting up each pin in a way that current does not flow.\n * and you can wait for interrupts while waiting.\n *\/\nvoid loop(){\n  \n  \/\/ enable interrupts before going to sleep\/wait\n  \/\/ And we setup a callback for the arduino INT handler.\n  attachInterrupt(arduinoInterrupt,intCallBack,FALLING);\n  \n  \/\/ Simulate a deep sleep\n  while(!awakenByInterrupt);\n  \/\/ Or sleep the arduino, this lib is great, if you have it.\n  \/\/LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);\n  \n  \/\/ disable interrupts while handling them.\n  detachInterrupt(arduinoInterrupt);\n  \n  if(awakenByInterrupt) handleInterrupt();\n}\n\n\nI hope that this shows you another way of using this versatile IC, \nIn a future post, I will show you how to do interrupts, using the native Wire library, as well as point out a few things about why interrrupts sometimes does not seem to be working, as well as a workaround for that.\n<\/code><\/pre>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit&#8217;s library for this IC. I believe that this library brings a lot of ease-of-use &hellip; <a href=\"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MCP23017 with Adafruit Library&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":775,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,40,51,50,52],"tags":[],"class_list":["post-814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-esp32","category-i2c-devices","category-io-extender-outputs","category-port-extender-inputs"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit&#039;s library for this IC. I believe that this library brings a lot of ease-of-use\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"makeriot2020\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Maker and IOT Ideas - Infinite possibilities, waiting to be explored\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"MCP23017 with Adafruit Library - Maker and IOT Ideas\" \/>\n\t\t<meta property=\"og:description\" content=\"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit&#039;s library for this IC. I believe that this library brings a lot of ease-of-use\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"165\" \/>\n\t\t<meta property=\"og:image:height\" content=\"93\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-10-30T13:56:26+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-05-28T08:08:34+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"MCP23017 with Adafruit Library - Maker and IOT Ideas\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit&#039;s library for this IC. I believe that this library brings a lot of ease-of-use\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#blogposting\",\"name\":\"MCP23017 with Adafruit Library - Maker and IOT Ideas\",\"headline\":\"MCP23017 with Adafruit Library\",\"author\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/20201013_141246-scaled.jpg\",\"width\":1920,\"height\":2560},\"datePublished\":\"2020-10-30T20:56:26+07:00\",\"dateModified\":\"2022-05-28T15:08:34+07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#webpage\"},\"articleSection\":\"Arduino, ESP32, I2C Devices, IO-Extender-Outputs, Port Extender-Inputs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.makeriot2020.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/category\\\/arduino\\\/#listItem\",\"name\":\"Arduino\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/category\\\/arduino\\\/#listItem\",\"position\":2,\"name\":\"Arduino\",\"item\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/category\\\/arduino\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#listItem\",\"name\":\"MCP23017 with Adafruit Library\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#listItem\",\"position\":3,\"name\":\"MCP23017 with Adafruit Library\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/category\\\/arduino\\\/#listItem\",\"name\":\"Arduino\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/#organization\",\"name\":\"Maker and IOT Ideas\",\"description\":\"Infinite possibilities, waiting to be explored\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/LogoSmall.jpg\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#organizationLogo\",\"width\":165,\"height\":93},\"image\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"makeriot2020\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#authorImage\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/wp-content\\\/wphb-cache\\\/gravatar\\\/5c0\\\/5c020e1b07a03d905edecd8711801fe8x96.jpg\",\"width\":96,\"height\":96,\"caption\":\"makeriot2020\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#webpage\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/\",\"name\":\"MCP23017 with Adafruit Library - Maker and IOT Ideas\",\"description\":\"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\\\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit's library for this IC. I believe that this library brings a lot of ease-of-use\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/20201013_141246-scaled.jpg\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#mainImage\",\"width\":1920,\"height\":2560},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/index.php\\\/2020\\\/10\\\/30\\\/mcp23017-with-adafruit-library\\\/#mainImage\"},\"datePublished\":\"2020-10-30T20:56:26+07:00\",\"dateModified\":\"2022-05-28T15:08:34+07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/#website\",\"url\":\"https:\\\/\\\/www.makeriot2020.com\\\/\",\"name\":\"Maker and IOT Ideas\",\"description\":\"Infinite possibilities, waiting to be explored\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.makeriot2020.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"MCP23017 with Adafruit Library - Maker and IOT Ideas","description":"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit's library for this IC. I believe that this library brings a lot of ease-of-use","canonical_url":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#blogposting","name":"MCP23017 with Adafruit Library - Maker and IOT Ideas","headline":"MCP23017 with Adafruit Library","author":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.makeriot2020.com\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2020\/10\/20201013_141246-scaled.jpg","width":1920,"height":2560},"datePublished":"2020-10-30T20:56:26+07:00","dateModified":"2022-05-28T15:08:34+07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#webpage"},"isPartOf":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#webpage"},"articleSection":"Arduino, ESP32, I2C Devices, IO-Extender-Outputs, Port Extender-Inputs"},{"@type":"BreadcrumbList","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com#listItem","position":1,"name":"Home","item":"https:\/\/www.makeriot2020.com","nextItem":{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/#listItem","name":"Arduino"}},{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/#listItem","position":2,"name":"Arduino","item":"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#listItem","name":"MCP23017 with Adafruit Library"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#listItem","position":3,"name":"MCP23017 with Adafruit Library","previousItem":{"@type":"ListItem","@id":"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/#listItem","name":"Arduino"}}]},{"@type":"Organization","@id":"https:\/\/www.makeriot2020.com\/#organization","name":"Maker and IOT Ideas","description":"Infinite possibilities, waiting to be explored","url":"https:\/\/www.makeriot2020.com\/","logo":{"@type":"ImageObject","url":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#organizationLogo","width":165,"height":93},"image":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.makeriot2020.com\/index.php\/author\/admin\/#author","url":"https:\/\/www.makeriot2020.com\/index.php\/author\/admin\/","name":"makeriot2020","image":{"@type":"ImageObject","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#authorImage","url":"https:\/\/www.makeriot2020.com\/wp-content\/wphb-cache\/gravatar\/5c0\/5c020e1b07a03d905edecd8711801fe8x96.jpg","width":96,"height":96,"caption":"makeriot2020"}},{"@type":"WebPage","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#webpage","url":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/","name":"MCP23017 with Adafruit Library - Maker and IOT Ideas","description":"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit's library for this IC. I believe that this library brings a lot of ease-of-use","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.makeriot2020.com\/#website"},"breadcrumb":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#breadcrumblist"},"author":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/author\/admin\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2020\/10\/20201013_141246-scaled.jpg","@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#mainImage","width":1920,"height":2560},"primaryImageOfPage":{"@id":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/#mainImage"},"datePublished":"2020-10-30T20:56:26+07:00","dateModified":"2022-05-28T15:08:34+07:00"},{"@type":"WebSite","@id":"https:\/\/www.makeriot2020.com\/#website","url":"https:\/\/www.makeriot2020.com\/","name":"Maker and IOT Ideas","description":"Infinite possibilities, waiting to be explored","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.makeriot2020.com\/#organization"}}]},"og:locale":"en_US","og:site_name":"Maker and IOT Ideas - Infinite possibilities, waiting to be explored","og:type":"article","og:title":"MCP23017 with Adafruit Library - Maker and IOT Ideas","og:description":"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit's library for this IC. I believe that this library brings a lot of ease-of-use","og:url":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/","og:image":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg","og:image:secure_url":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg","og:image:width":165,"og:image:height":93,"article:published_time":"2020-10-30T13:56:26+00:00","article:modified_time":"2022-05-28T08:08:34+00:00","twitter:card":"summary_large_image","twitter:title":"MCP23017 with Adafruit Library - Maker and IOT Ideas","twitter:description":"In a previous post, I have shown you how to use the MCP23017 16 Port I2C I\/O Port extender with the standard Wire library, as supplied with the Arduino IDE. In this post,I will have a quick look at using Adafruit's library for this IC. I believe that this library brings a lot of ease-of-use","twitter:image":"https:\/\/www.makeriot2020.com\/wp-content\/uploads\/2022\/06\/LogoSmall.jpg"},"aioseo_meta_data":{"post_id":"814","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2022-03-31 05:04:08","updated":"2026-06-29 02:48:12","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.makeriot2020.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/\" title=\"Arduino\">Arduino<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMCP23017 with Adafruit Library\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.makeriot2020.com"},{"label":"Arduino","link":"https:\/\/www.makeriot2020.com\/index.php\/category\/arduino\/"},{"label":"MCP23017 with Adafruit Library","link":"https:\/\/www.makeriot2020.com\/index.php\/2020\/10\/30\/mcp23017-with-adafruit-library\/"}],"_links":{"self":[{"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":0,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/media\/775"}],"wp:attachment":[{"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.makeriot2020.com\/index.php\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}