Cover image
Adafruit-MCP23017-arduino-bibrary
Private

Adafruit-MCP23017-arduino-bibrary

Try Now
2023-11-15

Biblioteca Arduino para Adafruit MCP23017

3 years

Works with Finder

33

Github Watches

205

Github Forks

369

Github Stars

Adafruit MCP23017 Arduino Library Build StatusDocumentation

This is a library for the MCP23008/17 I2C and MCP23S08/17 SPI Port Expanders.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Carter Nelson for Adafruit Industries. BSD license, check license.txt for more information All text above must be included in any redistribution

To install, use the Arduino IDE Library Manager.

Pin Addressing

When using single pin operations such as pinMode(pinId, dir) or digitalRead(pinId) or digitalWrite(pinId, val) then the pins are addressed using the ID's below. For example, for set the mode of GPB0 then use pinMode(8, ...). NOTE The MCP23008 and MCP23S08 only have GPAx pins.

MCP23x08 Pin # MCP23x17 Pin # Pin Name Pin ID
10 21 GPA0 0
11 22 GPA1 1
12 23 GPA2 2
13 24 GPA3 3
14 25 GPA4 4
15 26 GPA5 5
16 27 GPA6 6
17 28 GPA7 7
-- 1 GPB0 8
-- 2 GPB1 9
-- 3 GPB2 10
-- 4 GPB3 11
-- 5 GPB4 12
-- 6 GPB5 13
-- 7 GPB6 14
-- 8 GPB7 15

Use of HW address pins for SPI device

Library supports MCP23Sxx HW pin addressing (A2, A1, A0 for S17 and A1, A0 for S08) To use it provide HW address to begin_SPI(CS, SPI, HW_ADDR) function, and as a result each SPI message will contain correct chip address.

Example: mcp.begin_SPI(10, &SPI, 0b101);

HW Address recognition must be enabled by enableAddrPins() function. NOTE Calling enableAddrPins() will enable IOCON.HAEN bit for all active (CS low) devices on SPI bus. NOTE There is hardware bug in the MCP23S17 chip, see "MCP23S17 Rev. A Silicon Errata". As a result, if using device with A2 = high, and not using addressing, hw address must be set to 0b1XX In such case, even if not using addressing, initalize your MCP23S17 chip with 0b1XX address, eg: mcp.begin_SPI(10, &SPI, 0b100);.

Warning

Some people have reported an undocumented bug that can potentially corrupt the I2C bus. It occurs if an MCP230XX input pin state changes during I2C readout. This should be very rare. For more information, see this forum post and this knowledge base article.

相关推荐

  • GreenPepper Consulting India Private Limited
  • Formal yet conversational interview questions

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • 1Panel-dev
  • 🔥 1Panel proporciona una interfaz web intuitiva y un servidor MCP para administrar sitios web, archivos, contenedores, bases de datos y LLM en un servidor de Linux.

  • GeyserMC
  • Una biblioteca para la comunicación con un cliente/servidor de Minecraft.

  • awslabs
  • Servidores AWS MCP: servidores MCP especializados que traen las mejores prácticas de AWS directamente a su flujo de trabajo de desarrollo

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • GLips
  • Servidor MCP para proporcionar información de diseño de figma a agentes de codificación de IA como Cursor

  • Byaidu
  • Traducción de papel científico en PDF con formatos preservados - 基于 Ai 完整保留排版的 PDF 文档全文双语翻译 , 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 等服务 等服务 等服务 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 cli/mcp/docker/zotero

  • rulego
  • ⛓️Rulego es un marco de motor de regla de orquestación de componentes de alta generación de alto rendimiento, de alto rendimiento y de alto rendimiento para GO.

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • activepieces
  • AI AGENTES & MCPS & AI AUTOMACIÓN DE FLUILES DE TRABAJO • (280+ Servidores MCP para agentes de IA) • Automatización de IA / Agente de AI con MCPS • Flujos de trabajo de IA y agentes de IA • MCP para agentes de IA

    Reviews

    5 (1)
    Avatar
    user_bg3zZ2Kb
    2025-04-17

    The Adafruit-MCP23017-Arduino-Library is an essential tool for anyone working with MCP23017. It's incredibly user-friendly, well-documented, and the support from the Adafruit community is outstanding. This library makes integrating MCP23017 with Arduino straightforward and efficient, saving valuable development time. Highly recommended for all Arduino enthusiasts!