aht20-sensor
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

aht20-sensor

A Node.js I2C module for the Adafruit AHT20 Humidity/Temperature Sensor.

Installation

npm install aht20-sensor

Example

const { default: AHT20 } = require('aht20-sensor');

AHT20.open().then(async (sensor) => {
    try {
        const temp = await sensor.temperature();
        const hum = await sensor.humidity();
        console.log(temp, hum);
    }
    catch(err) {
        console.error("Failed to get temperature or humidity data.");
    }
}).catch((err) => {
    console.error("Failed to open bus.");
});

Wiring

Wiring can be found here: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-aht20.pdf

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    15
  • 1.0.1
    1
  • 1.0.0
    0
  • 0.1.1
    2
  • 0.1.0
    0

Package Sidebar

Install

npm i aht20-sensor

Weekly Downloads

18

Version

1.0.2

License

MIT

Unpacked Size

28.1 kB

Total Files

8

Last publish

Collaborators

  • thomome