node-raspi-pico-ups
v1.0.3
Published
Node helper to access pico ups states and variables
Downloads
3
Readme
node-raspi-pico-ups
Node helper to access pico ups info for pimodules' HV3.0a 450 model
Installation
NPM
npm install --save node-raspi-pico-ups
Usage
getPowerModeLabel
Retrurn the label of the power mode (usb or battery)
var pico = require('node-raspi-pico-ups');
console.log('Current power mode :', pico.getPowerModeLabel(val));
//Current power mode : usb
getCurrentPowerMode
Returns the current battery mode (1 for usb, 2 for battery)
var pico = require('node-raspi-pico-ups');
console.log('Current power mode :', pico.getCurrentPowerMode());
//Current power mode : 1
getCurrentBatteryVoltage
Returns the battery voltage
var pico = require('node-raspi-pico-ups');
console.log('Current Battery voltage :', pico.getCurrentBatteryVoltage(), 'V');
//Current Battery voltage : 4.21 V
getCurrentRpiVoltage
Returns the raspberry's current power supply voltage
var pico = require('node-raspi-pico-ups');
console.log('Current Power voltage :', pico.getCurrentRpiVoltage(), 'V');
//Current Power voltage : 4.882 V
getTemperature
Returns the temperature mesured by the embedded NTC1 sensor
var pico = require('node-raspi-pico-ups');
console.log('Temperature :', pico.getTemperature(), '°C');
//Temperature : 50 °C
printInfo
Prints collected info to the console
var pico = require('node-raspi-pico-ups');
pico.printInfo();
renders :
Current power mode : usb
Current Battery voltage : 4.21 V
Current Power voltage : 4.882 V
Temperature : 50 °C