MCP342x¶
A Python module to support Microchip MCP342x analogue to digital converters. The devices use the I2C bus. For the low level I2C protocol this module depends on SMBus.
Supported devices¶
- MCP3422: 2 channel, 12, 14, 16, or 18 bit
- MCP3423: 2 channel, 12, 14, 16, or 18 bit
- MCP3424: 4 channel, 12, 14, 16, or 18 bit
- MCP3426: 2 channel, 12, 14, or 16 bit
- MCP3427: 2 channel, 12, 14, or 16 bit
- MCP3428: 4 channel, 12, 14, or 16 bit
The MCP3422 and MCP3426 use I2C address 0x68, all other devices can be configured to use any address in the range 0x68 - 0x6F (inclusive).
-
class
MCP342x.MCP342x(bus, address, device='MCP3424', channel=0, gain=1, resolution=12, continuous_mode=False, scale_factor=1.0, offset=0.0)¶ Class to represent MCP342x ADC.
-
configure()¶ Configure the device.
Send the device configuration saved inside the MCP342x object to the target device.
-
convert()¶ Initiate one-shot conversion.
The current settings are used, with the exception of continuous mode.
-