Device::Chip::ADC121Sx - chip driver for ADC121Sx family
Device::Chip::ADC121Sx
use Device::Chip::ADC121Sx; use Future::AsyncAwait; my $chip = Device::Chip::ADC121Sx->new; await $chip->mount( Device::Chip::Adapter::...->new ); printf "The reading is %d\n", await $chip->read_adc;
This Device::Chip subclass provides specific communications to a chip in the Texas Instruments ADC121Sx family, such as ADC121S021, ADC121S051 or ADC121S101.
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 following methods documented in an await expression return Future instances.
await
$value = await $chip->read_adc;
Performs a conversion and returns the result as a plain unsigned 12-bit integer.
$ratio = await $chip->read_adc_ratio;
Performs a conversion and returns the result as a floating-point number between 0 and 1.
Paul Evans <leonerd@leonerd.org.uk>
To install Device::Chip::AnalogConverters, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Chip::AnalogConverters
CPAN shell
perl -MCPAN -e shell install Device::Chip::AnalogConverters
For more information on module installation, please visit the detailed CPAN module installation guide.