From cc9137629dfae82e03a788c062bf826c1a0df128 Mon Sep 17 00:00:00 2001 From: Angelus Vela Date: Thu, 1 Oct 2026 10:44:40 -0600 Subject: [PATCH] Library for HTU21D --- htu21d.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 htu21d.h diff --git a/htu21d.h b/htu21d.h new file mode 100644 index 0000000..e927896 --- /dev/null +++ b/htu21d.h @@ -0,0 +1,19 @@ +// Christian Angelus Vela Rico 1/oct/2026 +// HTU21D temperature and humidity sensor library +// tested in a rasperry pi zero w + +#ifndef HTU21D_H +#define HTU21D_H + +// commands and i2c address +#define ADDR 0x40 //i2c address +#define HUM 0xE5 // hold master humidity command +#define TEMP 0xE3 +#define RESET 0xFE + +// prototype functions +int getTemp(int fd, double *temp); + +int getHum(int fd, double *hum); + +#endif // HTU21D_H