adafruit_mcp9808
¶
CircuitPython library to support MCP9808 high accuracy temperature sensor.
- Author(s): Scott Shawcroft
Implementation Notes¶
Hardware:
- Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout (Product ID: 1782)
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Notes:
-
class
adafruit_mcp9808.
MCP9808
(i2c_bus, address=24)[source]¶ Interface to the MCP9808 temperature sensor.
Parameters: Quickstart: Importing and using the MCP9808
Here is an example of using the
MCP9808
class. First you will need to import the libraries to use the sensorimport board import adafruit_mcp9808
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA mcp = adafruit_mcp9808.MCP9808(i2c_bus)
Now you have access to the change in temperature using the
temperature
attribute. This temperature is in Celsius.temperature = mcp.temperature
-
temperature
¶ Temperature in Celsius. Read-only.
-