Electrical units library for embedded Rust targets focusing on ease-of-use and performance.
Supports no_std
environments.
Greatly inspired by the fugit crate.
The Current
, Resistance
and Voltage
types follow the Ohm's Law rules.
This means that you can use the /
and *
operators to calculate the missing value.
For example, Voltage / Current
will return a Resistance
value.
All Ohms Law calculations are done using u64
intermediary values to prevent overflow/underflow while calculating.
You can add this crate via crates.io:
$ cargo add ohms
You can find the documentation here.