Device::Chip::HTU21D - chip driver for HTU21D
use Device::Chip::HTU21D; use Future::AsyncAwait; my $chip = Device::Chip::HTU21D->new; await $chip->mount( Device::Chip::Adapter::...->new ); printf "Current temperature is is %.2f C\n", await $chip->read_temperature;
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 in an
await expression return Future instances.
$config = await $chip->read_config;
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
await $chip->change_config( %changes );
Writes updates to the user register.
$temperature = await $chip->read_temperature;
Triggers a reading of the temperature sensor, returning a number in degrees C.
$humidity = await $chip->read_humidity;
Triggers a reading of the humidity sensor, returning a number in % RH.
Paul Evans <email@example.com>