sensordrone
v0.1.1
Published
Node.js lib for the Sensordrone
Downloads
1
Maintainers
Readme
node-sensordrone
Node.js lib for the Sensorcon Sensordrone
Special thanks to @mrose17 for sending me a Sensordrone!
Notes
Protocol determined from:
Try resetting the Sensordrone if connection or service/characteristic discovery hangs
Prerequisites
- See noble prerequisites for your platform
Install
npm install sensordrone
Usage
var Sensordrone = require('sensordrone');
Discover
Sensordrone.discover(callback(sensordrone));
Connect
sensordrone.connect(callback);
Disconnect
sensordrone.disconnect(callback);
Discover Services and Characteristics
sensordrone.discoverServicesAndCharacteristics(callback);
Battery Voltage
sensorTag.readBatteryVoltage(callback(voltage));
LED's
// values 0 - 255
sensordrone.setLeds(leftRed, leftGreen, leftBlue, rightRed, rightGreen, rightBlue, callback);
Ambient Temperature
sensorTag.readAmbientTemperature(callback(temperature));
Humidity
sensorTag.readHumidity(callback(humidity));
Pressure
Enable/disable:
sensordrone.enablePressure(callback);
sensordrone.disablePressure(callback);
Read:
sensordrone.readPressure(callback(pressure));
Altitude (based on pressure)
Enable/disable:
sensordrone.enableAltitude(callback);
sensordrone.disableAltitude(callback);
Read:
sensordrone.readAltitude(callback(altitude));
RGBC
Enable/disable:
sensordrone.enableRGBC(callback);
sensordrone.disableRGBC(callback);
Read:
sensordrone.readRGBC(callback(r, g, b, c, lux, temp)); // temp in Kelvins
IR Temperature
Enable/disable:
sensordrone.enableIrTemperature(callback);
sensordrone.disableIrTemperature(callback);
Read:
sensordrone.readIrTemperature(callback(temperature));
Precision Gas
sensordrone.readPrecisionGas(callback(ppmCO));
Oxidizing Gas
Enable/disable:
sensordrone.enableOxidizingGas(callback);
sensordrone.disableOxidizingGas(callback);
Read:
sensordrone.readOxidizingGas(callback(ohms));
Reducing Gas
Enable/disable:
sensordrone.enableReducingGas(callback);
sensordrone.disableReducingGas(callback);
Read:
sensordrone.readReducingGas(callback(ohms));
ADC
sensordrone.readADC(callback(voltage));
Capacitance
Enable/disable:
sensordrone.enableCapacitance(callback);
sensordrone.disableCapacitance(callback);
Read:
sensordrone.readCapacitance(callback(capacitance));
UART
Write:
sensordrone.writeUart(data, callback);
Read:
sensordrone.readUart(callback(data));
External CO2 sensor
Setup:
sensordrone.setupExternalCO2(callback);
Read:
sensordrone.readExternalCO2(callback(ppm));