rust-embedded-community / rust-measurements

Metric, Imperial, and other measurement handling for Rust. Length, Temperature, Weight, and Volume
https://crates.io/crates/measurements
27 stars 10 forks source link

Add Current and Resistance units #15

Closed dbrgn closed 6 years ago

dbrgn commented 6 years ago

Add the remaining units for Ohm's law.

Also implement the P = U * I relation. This only applies to DC power though, not to AC where the time is relevant. Do you think it's still correct to keep the conversions?

Fixes #9.

thejpster commented 6 years ago

I think that P = V * I still holds if V is the root-mean-square of the sinusoidal AC voltage. But I agree we could quickly get into complex impedance, power factors and all sorts of second-year engineering degree fun.

dbrgn commented 6 years ago

Example fixed.

dbrgn commented 6 years ago

Would be great to get a release after this has been merged, then I can add it as an optional feature to the mcp3425 crate :slightly_smiling_face:

dbrgn commented 6 years ago

By the way, the README needs an update regarding version numbers and supported units.

dbrgn commented 6 years ago

Any updates? This is the last thing I'd like to integrate into the mcp3425 crate before releasing. :slightly_smiling_face:

thejpster commented 6 years ago

Merged, updated and published.

dbrgn commented 6 years ago

Awesome, thanks! :sparkles: