Device::Chip::MCP3221 - chip driver for MCP3221
use Device::Chip::MCP3221; my $chip = Device::Chip::MCP3221->new; $chip->mount( Device::Chip::Adapter::...->new )->get; printf "The reading is %d\n", $chip->read_adc->get;
This Device::Chip subclass provides specific communications to a Microchip MCP3221 chip.
The reader is presumed to be familiar with the general operation of this chip; the documentation here will not attempt to explain or define chip-specific concepts or features, only the use of this module to access them.
The I²C address of the device. Can be specified in decimal, octal or hex with leading
The following methods documented with a trailing call to
->get return Future instances.
$value = $chip->read_adc->get
Performs a conversion and returns the result as a plain unsigned 12-bit integer.
$ratio = $chip->read_adc_ratio->get
Performs a conversion and returns the result as a floating-point number between 0 and 1.
Paul Evans <email@example.com>