GY-63_MS5611/libraries/weight/README.md
2022-11-27 11:13:09 +01:00

2.4 KiB

Arduino CI Arduino-lint JSON check License: MIT GitHub release

Weight

Library of weight conversion functions.

Description

Weight.h is a library containing weight conversion functions.

Open for additions, including obscure weight metrics or weight related math functions and constants.

Interface

Overview of conversions:

          stone - lbs - ounce
            |      |      |
           kilo   kilo - gram


           kilo - (stone, lbs, ounce)

Functions are straightforward.

  • float lbs2kilo(float lbs)
  • float kilo2lbs(float kilos)
  • float ounce2gram(float ounce)
  • float gram2ounce(float gram)
  • float gram2kilo(float gram)
  • float kilo2gram( float kilo)
  • float lbs2ounce(float lbs)
  • float ounce2lbs(float ounce)
  • float stone2lbs(float stone)
  • float lbs2stone(float lbs)
  • float stone2kilo(float stone)
  • float kilo2stone(float kilo)
  • float US2metric(float stone, float lbs, float ounce)
  • float metric2US(float kilo, float &stone, float &lbs, float &ounce)

Operation

See examples

Future

must

  • improve documentation

should

  • a class like the temperature convertor and pressure convertor
    • internally grams?
    • getters setters

could

  • create data types of stone lbs kilo etc.?

won't (unless)

  • large masses - sun planets ? (see relativity library)
  • gravity constants of planets REL or ABS eg REL_GRAVITY_EARTH 1.0
  • mass of all elements
    • an array of floats
    • a compressed format with access function (1 byte/ element)
    • constants e.g. MASS_OXYGEN
    • separate periodicTable.h file ?
  • molarity functions
  • mass of common substances.
  • teaspoon
    • that is a volume unit.
    • volume conversion too?