Skip to content

A port of the Adafruit Arduino driver for the HTU21D(F) sensor

License

Notifications You must be signed in to change notification settings

pedalPusher68/arduino-adafruit-htu21df

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino Adafruit HTU21D(D) library for Mongoose OS

This is a port of the Adafruit Arduino driver for the HTU21D(F) sensor ported to run on the Mongoose OS ecosystem.

Usage is extremely simple....

in mos.yml, add to libs: section,

- origin: https://github.com/pedalPusher68/arduino-adafruit-htu21df

in your init.js, add something like the following,

load('api_arduino_htu21df.js');

and

// Initialize Adafruit_HTU21DF library
let htu = Adafruit_HTU21DF.create();
htu.begin();
let htuGetData = function () {
    print('HTU21D:  T: ', htu.readTemperature() ,'C     RH: ', htu.readHumidity(), '%');
};
let htuTimer = Timer.set(10000 /* milliseconds */, true /* repeat */, htuGetData, null);

to use the library.

Enjoy!