Coder Social home page Coder Social logo

tannewt / adafruit_circuitpython_mcp9808 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adafruit/adafruit_circuitpython_mcp9808

0.0 3.0 0.0 40 KB

CircuitPython drivers for the MCP9808 i2c high accuracy temperature sensor.

License: MIT License

Python 100.00%

adafruit_circuitpython_mcp9808's Introduction

Introduction

The MCP9808 is an awesome, high accuracy temperature sensor that communicates over I2C. Its available on Adafruit as a breakout.

Dependencies

This driver depends on the Bus Device library. Please ensure it is also available on the CircuitPython filesystem. This is easily achieved by downloading a library and driver bundle.

Usage Notes

Getting the temperature in Celsius is easy! First, import all of the pins from the board, busio for native I2C communication and the thermometer library itself.

from board import *
import busio
import adafruit_mcp9808

Next, initialize the I2C bus in a with statement so it always gets shut down ok. Then, construct the thermometer class:

# Do one reading
with busio.I2C(SCL, SDA) as i2c:
    t = adafruit_mcp9808.MCP9808(i2c)

    # Finally, read the temperature property and print it out
    print(t.temperature)

API Reference

api

adafruit_circuitpython_mcp9808's People

Contributors

tannewt avatar ncguk avatar tdicola avatar mrmcwethy avatar ryespy avatar

Watchers

 avatar James Cloos 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.