# Adafruit-MCP23017-Arduino-Library

> MCP Client

This repository provides an Arduino library for the MCP23008/17 I2C and MCP23S08/17 SPI port expanders, enabling users to easily interface with and control these devices using Arduino boards. Pin addressing

## Overview

- **Category:** Developer Tools
- **Language:** C++
- **Stars:** 382
- **Forks:** 205
- **Owner:** adafruit
- **GitHub:** https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
- **Created:** 2012-02-14T17:02:06+00:00
- **Updated:** 2025-03-28T21:39:29+00:00
- **Source:** https://model-context-protocol.com/clients/arduino-mcp23017-port-expander-library

## Setup

## Setup
To install, use the Arduino IDE Library Manager.

## Tools

## Available Tools

1.  MCP23008/17 I2C and MCP23S08/17 SPI Port Expanders (Provides I/O expansion capabilities).
2.  `pinMode(pinId, dir)` (Sets the mode of a specific pin).
3.  `digitalRead(pinId)` (Reads the digital value of a specific pin).
4.  `digitalWrite(pinId, val)` (Writes a digital value to a specific pin).
5.  HW pin addressing (A2, A1, A0 for S17 and A1, A0 for S08) (Supports hardware pin addressing for SPI devices).
6.  `begin_SPI(CS, SPI, HW_ADDR)` (Initializes SPI communication with a specific hardware address).
7.  `enableAddrPins()` (Enables hardware address recognition by setting the IOCON.HAEN bit).
