CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
me405_lab4.MCP9808 Class Reference

Public Member Functions

def __init__ (self, i2c, address, manuf_id=0b01010100)
 A method to initialize an MCP9808 object. More...
 
def check (self)
 
def celsius (self)
 A method to get the temperature in Celcius from the MCP9808. More...
 
def fahrenheit (self)
 A method to get the temperature in Fahrenheit from the MCP9808. More...
 
def collect (self, sample_time, num_samples, scale='C')
 A method to collect a series of temperature readings over time. More...
 

Public Attributes

 i2c
 A pyb.I2C object to use for communicating with the MCP9808.
 
 addr
 The i2c address of the MCP9808 address.
 
 id
 The manufacturer id of the MCP9808 chip.
 

Constructor & Destructor Documentation

◆ __init__()

def me405_lab4.MCP9808.__init__ (   self,
  i2c,
  address,
  manuf_id = 0b01010100 
)

A method to initialize an MCP9808 object.

Parameters
i2cA pyb.I2C object to use for communicating with the MCP9808.
addressThe i2c address of the MCP9808 address.
manuf_idThe manufacturer id of the MCP9808 chip, used to check communication with the MCP9808 chip using the me405_lab4.MCP9808.check method.

Member Function Documentation

◆ celsius()

def me405_lab4.MCP9808.celsius (   self)

A method to get the temperature in Celcius from the MCP9808.

Returns
The ambient temperature in Celcius.

◆ collect()

def me405_lab4.MCP9808.collect (   self,
  sample_time,
  num_samples,
  scale = 'C' 
)

A method to collect a series of temperature readings over time.

Parameters
sample_timeThe time between samples, in milli seconds
durrationThe number of samples to record
Returns
A floating point array of [[time_stamp, temperature]]

◆ fahrenheit()

def me405_lab4.MCP9808.fahrenheit (   self)

A method to get the temperature in Fahrenheit from the MCP9808.

Returns
The ambient temperature in Fahrenheit.

The documentation for this class was generated from the following file: