⚖ Measure weight using a Stamps.com digital USB postage scale.
MIT License
Measure weight using a Stamps.com digital USB postage scale.
I successfully performed these steps in September 2014. Today, it may work differently, or not at all.
This package is available on npm.
$ npm install webscale
In the event of installation trouble, refer to the node-hid documentation.
const WebScale = require('webscale');
const webScale = new WebScale();
webScale.on('change:weight', ounces => {
console.log(`${ounces} oz.`);
});
See also test-client.js
.
Called whenever the scale's weight reading changes.
Called when the program first starts and connects successfully to the device, or when it reconnects after losing the connection.
Called when the device is unplugged or powered off, and once per reconnect attempt.
An error with the USB device occurred (except disconnections, see above).
Reset the scale so the current weight will be read as zero. The scale will also automatically tare itself each time it powers on.
Disconnect from the USB device.