Skip to content

Commit

Permalink
Added mongoose-os documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pedalPusher68 committed Nov 27, 2017
1 parent 885e0fc commit 0efd65e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions mjs_fs/api_arduino_htu21df.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,47 @@ let Adafruit_HTU21DF = {

_proto: {

// functions
// Public functions

// ## **`myHTU.begin()`**
// Initialize sensor and make it ready for use.
// Return value: 1 if sensor is ready, 0 otherwise.
begin: function () {
return Adafruit_HTU21DF._begin(this.tsl);
return Adafruit_HTU21DF._begin(this.htu);
},

// ## **`myHTU.readTemperature()`**
// Read the current temperature.
// Return value: current temperature value in Celsius as a double.
readTemperature: function () {
return Adafruit_HTU21DF._rdTp(this.tsl);
return Adafruit_HTU21DF._rdTp(this.htu);
},

// ## **`myHTU.readHumidity()`**
// Read the current relative humidity as a percentage.
// Return value: current humidity value as a double.
readHumidity: function () {
return Adafruit_HTU21DF._rdHm(this.tsl);
return Adafruit_HTU21DF._rdHm(this.htu);
},

// ## **`myHTU.reset()`**
// Reset the sensor - sends the sensor-specific command to reset.
// Return value: none
reset: function () {
Adafruit_HTU21DF._rst(this.tsl);
Adafruit_HTU21DF._rst(this.htu);
}

},

// ## **`Adafruit_HTU21DF.create()`**
// Create an Adafruit_HTU21DF instance on I2C bus (address = 0x40).
// Return value: an object with the methods defined in _proto: {...} (above).
create: function () {
let obj = Object.create(Adafruit_HTU21DF._proto);
// set default parameter values
// Initialize Adafruit_HTU21DF library.
// Return value: handle opaque pointer.
obj.tsl = Adafruit_HTU21DF._create();
obj.htu = Adafruit_HTU21DF._create();
return obj;
}

Expand Down

0 comments on commit 0efd65e

Please sign in to comment.