Git Product home page Git Product logo

mcp23s17's Introduction

Mcp23s17

A C++ object to control the Microchip MCP23S17 16-bit IO Expander. For the Arduino Platform.

Introduction

Mcp23s17 is a simple object which mimics the typical Arduino functions for digital reads, digital writes, to set output pins etc. To use, we just wire up the SPI bus and instantiate a new object. By default, the chip powers up with all pins configured as high-impedance inputs. This library may also work with other AVR microcontroller devices (after some tweaking). This library was tested on Arduino UNO.

Features

  • All 16 pins are read / written to at once
  • Generally fast SPI operation (up to 10Mhz)
  • Generic example (works with all 328P Arduinos)
  • Requires only very minor modifications for Arduino MEGA.
  • Can instantiate multiple Mcp23s17 objects, one for each connected device
  • Very simple interface and very few configuration
  • Single-pin commands obj.pinMode(), obj.digitalRead(), obj.digitalWrite()
  • As this is 16-bit IO expander, then 16-bit addressing with uint16_t datatype
  • obj.port() to read or write to both ports at once.
  • No methods for the 2x 8-bit ports individually (not needed).

Requirements

* Other versions of Arduino Spi library (such as SPI.h) wont work / wernt tested.

Getting Started

Pretty much everything is explained within the example sketch file. Open Mcp23s17Example.pde in Arduino IDE and upload it to your microcontroller device. Check that all of the SPI interface pins are connected OK for your device.

Dreamcat4

Credit

  • Mcp23s17 Version 1 - By Dreamcat4.

mcp23s17's People

Contributors

dreamcat4 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.