{"type":"mcp_client","name":"Adafruit-MCP23008-library","description":"Arduino library for MCP23008/9 I2C I/O expanders. Enables easy control of digital inputs/outputs via I2C.","category":"Developer Tools","language":"C++","stars":56,"forks":48,"owner":"adafruit","github_url":"https://github.com/adafruit/Adafruit-MCP23008-library","homepage":"http://www.ladyada.net/wiki/partselector/ic#io_expanders","setup":"## Setup\n\nThis library is archived and no longer maintained. Please use the replacement library: [https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library](https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library)\n\n**If you still need to use this library (Adafruit MCP23008 Library):**\n\n**Prerequisites:**\n\n*   Arduino IDE installed\n*   Adafruit BusIO library: [https://github.com/adafruit/Adafruit_BusIO](https://github.com/adafruit/Adafruit_BusIO)\n\n**Installation:**\n\n1.  Download the library by clicking \"Download Source\" in the top right corner of the GitHub page.\n2.  Unzip the downloaded archive.\n3.  Rename the extracted folder to `Adafruit_MCP23008`.\n4.  Move the `Adafruit_MCP23008` folder to your Arduino libraries folder.  (Typically located in your Documents folder under `Arduino/libraries/`).  If the `libraries` folder doesn't exist, create it.\n5.  Install the Adafruit BusIO library using the Arduino Library Manager (Sketch -> Include Library -> Manage Libraries...) or by manually downloading and installing it into your Arduino libraries folder.\n6.  Restart the Arduino IDE.\n\n**Wiring:**\n\nConnect the MCP23008 to your Arduino as follows:\n\n*   Pin #1 (SCL) of the expander to Analog 5 (I2C clock)\n*   Pin #2 (SDA) of the expander to Analog 4 (I2C data)\n*   Pins #3, 4 and 5 (A0, A1, A2) of the expander to ground (address selection)\n*   Pins #6 (RESET) and 18 (VDD) of the expander to 5V (power and reset disable)\n*   Pin #9 (VSS) of the expander to ground (common ground)\n*   Pins 10 thru 17 are your input/output pins\n\n**Configuration:**\n\n*   No specific configuration files or environment variables are needed. The library is configured through the Arduino code.\n\n**Datasheet:**\n\n*   Refer to the MCP23008 datasheet for more information: [http://ww1.microchip.com/downloads/en/DeviceDoc/21919b.pdf](http://ww1.microchip.com/downloads/en/DeviceDoc/21919b.pdf)","tools":"## Available Tools\n\nThis library provides basic functionality for controlling the MCP23008 I/O expander chip via I2C.  It currently supports the following features:\n\n*   **Setting Pin Directions:** Configures individual pins as either inputs or outputs.\n*   **Inputs and Outputs:** Reads digital input values from pins configured as inputs and sets digital output values on pins configured as outputs.\n*   **Pull-up Resistors:** Enables or disables internal pull-up resistors on individual pins.\n\n**Usage Examples:**\n\nWhile specific code examples are not provided in the README, the library allows you to:\n\n1.  **Set a pin as an output:**  You would use a function call (not explicitly shown, but likely named something like `pinMode()` or `digitalWrite()`) to configure a pin as an output.\n\n2.  **Write a HIGH or LOW value to an output pin:** Similar to the above, you would use a function call (likely `digitalWrite()`) to set the voltage level of an output pin.\n\n3.  **Set a pin as an input:**  Use a function call to configure a pin as an input.\n\n4.  **Read the value of an input pin:** Use a function call (likely `digitalRead()`) to retrieve the digital value (HIGH or LOW) of an input pin.\n\n5.  **Enable/Disable Pull-up Resistors:** Use a function call to enable or disable the internal pull-up resistor on a specific pin. This is useful for input pins that need a defined state when not actively driven.","faq":null,"created_at":"2010-09-01T20:21:54+00:00","updated_at":"2025-06-09T12:06:58+00:00","source_url":"https://model-context-protocol.com/clients/adafruit-mcp23008-library","related_articles":[]}