Giter Club home page Giter Club logo

mcp23017-rpi-lib's Introduction

MCP23017 RPI Library

This library provides an interface for the MCP23017 gpio expander chip. It is based on a python library of the same name, found here.

You can view the docs here.

Example - Blink

let mut mcp = MCP23017::new(0x20, 1).unwrap();
let led = Pin::new(0).unwrap();
mcp.pin_mode(&led, Mode::Output).unwrap();

loop {
    mcp.output(&led, State::High).unwrap();
    sleep(Duration::from_millis(200));
    mcp.output(&led, State::Low).unwrap();
    sleep(Duration::from_millis(200));
}  

Pin Conversion

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

License

This software is provided under the MIT license. Click here to view. The original python library is also licensed under MIT. It can be found here.

mcp23017-rpi-lib's People

Contributors

ellabellla 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.