Class that allows the user to communicate with the MCP9808 temperature sensor using its I2C interface. More...
Public Member Functions | |
| def | __init__ (self, i2c, addr) |
| Initializer for the class. More... | |
| def | check (self) |
| Verifies the sensor connection. More... | |
| def | celcius (self) |
| Measures the temperature in degrees Celcius. More... | |
| def | fahrenheit (self) |
| Measures the temperature in degrees Fahrenheit. More... | |
Public Attributes | |
| sens | |
| address | |
Class that allows the user to communicate with the MCP9808 temperature sensor using its I2C interface.
This class creates a MCP object that interfaces with the I2C object. The initializer is given a reference to an already created I2C object and the address of the MCP9808 on the I2C bus. This class also contains methods to veriy the sensor, and take temperature readings in Celcius and Fahrenheit.
| def mcp9808.iic.__init__ | ( | self, | |
| i2c, | |||
| addr | |||
| ) |
Initializer for the class.
Initializes the class using the reference to the I2C object and the MCP9808 address.
| i2c | I2C The I2C Serial Communication object. |
| addr | int The address of the MCP9808 |
| def mcp9808.iic.celcius | ( | self | ) |
Measures the temperature in degrees Celcius.
| def mcp9808.iic.check | ( | self | ) |
Verifies the sensor connection.
Verifies that the sensor is attached at the given bus address by checking the returned manufacture ID.
| def mcp9808.iic.fahrenheit | ( | self | ) |
Measures the temperature in degrees Fahrenheit.