Coder Social home page Coder Social logo

micropython-smbus's Introduction

micropython-smbus

A wrapper to provide methods of the CPython 'smbus' module on micropython

Provides an 'SMBus' module which supports some of the py-smbus i2c methods, as well as being a subclass of machine.I2C

Hopefully this will allow you to run code that was targeted at py-smbus, unmodified on micropython.

Usage

Use it like you would the machine.I2C class:

        import usmbus.SMBus 
        bus = SMBus(SMBus.MASTER, pins=('G15','G10'), baudrate=100000)
        
        # Example for the bme680:
        bme680.BME680(i2c_device=bus)

Work In Progress

This module came from a desire to use https://github.com/pimoroni/bme680 on a LoPy, so currently implements only the methods necessary to do that.

I'll be adding more as time goes on: issues/pull requests are very welcome.

micropython-smbus's People

Contributors

gkluoe avatar

Forkers

vroomfondel

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.