A Driver for the mcp9808 temperature sensor. More...
Public Member Functions | |
| def | __init__ (self, master=None, address=BUS_ADDRESS) |
| Construct a TempSensor object. More... | |
| def | check (self) |
| Checks if the mcp9808 exists at the specified address and that the manufacturer id matches. | |
| def | celsius (self) |
| Read the temperature in °C. More... | |
| def | fahrenheit (self) |
| Read the temperature in °F. More... | |
Public Attributes | |
| address | |
A Driver for the mcp9808 temperature sensor.
The I2C device address can be specified by changing the global BUS_ADDRESS variable. This wrapper subclasses the pyb.I2C object and accesses the mcp9808 as the master device.
| def mcp9808.TempSensor.__init__ | ( | self, | |
master = None, |
|||
address = BUS_ADDRESS |
|||
| ) |
Construct a TempSensor object.
| master | Optionally wrap an existing I2C.MASTER object. |
| address | Optionally specify the I2C bus address of the mcp9808. |
| def mcp9808.TempSensor.celsius | ( | self | ) |
Read the temperature in °C.
| def mcp9808.TempSensor.fahrenheit | ( | self | ) |
Read the temperature in °F.