Expand description
Weighty is a simple library for reading from USB HID scales, as well as an example utility that consumes the library and performs one reading on all available scales.
If you have a little compilation time to spare, I recommend using the units
feature to enable the read
method on the drivers, which prevents you from
bungling the units… not that you would… but I have.
Example:
use weighty;
for scale in weighty::get_all_scales() {
println!("{:?}kgf", scale.read_kilograms());
}
Enums§
- HidScale
Error - A list of things that can go wrong when reading from a digital scale.
Traits§
- Scale
Driver - A ScaleDriver takes care of decoding and making sense of the raw bytes coming from the HID scale.
Functions§
- get_
all_ scales - Returns a collection of drivers for all of the currently available scales.
- get_
scale_ by_ serial_ number - Returns one specific scale, if it is connected and we have access to it.
- get_
scales_ by_ usb_ id - Returns all of one specific type of scale that are currently connected.
Type Aliases§
- Result
- Type alias to simplify signatures.