Skip to content

Commit

Permalink
document how to use library
Browse files Browse the repository at this point in the history
  • Loading branch information
pedalPusher68 authored Nov 24, 2017
1 parent f136a3a commit 543b36c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ in mos.yml, add to **libs:** section,

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

`load('api_arduino_htu21df.js');`
```javascript
load('api_arduino_htu21df.js');
```

and

`// Initialize Adafruit_HTU21DF library
```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.

Expand Down

0 comments on commit 543b36c

Please sign in to comment.