Device::Chip::HTU21D - chip driver for HTU21D
use Device::Chip::HTU21D; my $chip = Device::Chip::HTU21D->new; $chip->mount( Device::Chip::Adapter::...->new )->get; printf "Current temperature is is %.2f C\n", $chip->read_temperature->get;
This Device::Chip subclass provides specific communication to a TE Connectivity HTU21D attached to a computer via an I²C adapter.
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 with a trailing call to
->get return Future instances.
$config = $chip->read_config->get
HASH reference of the contents of the user register.
RES => "12/14" | "11/11" | "10/13" | "8/12" OTPDISABLE => 0 | 1 HEATER => 0 | 1 ENDOFBATT => 0 | 1
$chip->change_config( %changes )->get
Writes updates to the user register.
$temperature = $chip->read_temperature->get
Triggers a reading of the temperature sensor, returning a number in degrees C.
$humidity = $chip->read_humidity->get
Triggers a reading of the humidity sensor, returning a number in % RH.
Paul Evans <email@example.com>