M5Unit-WEIGHT 0.1.1 git rev:97a7989
Loading...
Searching...
No Matches
m5::unit::weighti2c::Data Struct Reference

Measurement data group. More...

#include <unit_WeightI2C.hpp>

Public Member Functions

float weight () const
 Get the measured weight as a floating-point value.
 
int32_t iweight () const
 Get the measured weight as an integer value multiplied by 100.
 

Public Attributes

std::array< uint8_t, 4 > raw {}
 True if the payload should be interpreted with weight()
 
bool is_float {}
 

Detailed Description

Measurement data group.

Member Function Documentation

◆ iweight()

int32_t m5::unit::weighti2c::Data::iweight ( ) const
inline

Get the measured weight as an integer value multiplied by 100.

Returns
Measured weight x100 when is_float is false, otherwise INT32_MIN

◆ weight()

float m5::unit::weighti2c::Data::weight ( ) const
inline

Get the measured weight as a floating-point value.

Returns
Measured weight when is_float is true, otherwise NaN

Member Data Documentation

◆ raw

std::array<uint8_t, 4> m5::unit::weighti2c::Data::raw {}

True if the payload should be interpreted with weight()

RAW data