-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Arduino Adafruit HTU21D(D) library for Mongoose OS | ||
|
||
This is a port of the [Adafruit Arduino driver for the HTU21D(F) sensor](https://github.com/adafruit/Adafruit_HTU21DF_Library) ported to run on the [Mongoose OS ecosystem](https://mongoose-os.com/docs/reference/api.html). | ||
|
||
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, | ||
|
||
```javascript | ||
load('api_arduino_htu21df.js'); | ||
``` | ||
|
||
and | ||
|
||
```javascript | ||
// 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! |